diff mbox

[V3,1/2] target-ppc: Fix target_disas

Message ID 1396985174-13212-2-git-send-email-tommusta@gmail.com
State New
Headers show

Commit Message

Tom Musta April 8, 2014, 7:26 p.m. UTC
Inspect only bit 16 for the Little Endian test.  Correct comment preceding
the target_disas() function.

Signed-off-by: Tom Musta <tommusta@gmail.com>
---

V2: new

 disas.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Comments

Peter Maydell April 9, 2014, 7:31 a.m. UTC | #1
On 8 April 2014 20:26, Tom Musta <tommusta@gmail.com> wrote:
> Inspect only bit 16 for the Little Endian test.  Correct comment preceding
> the target_disas() function.
>
> Signed-off-by: Tom Musta <tommusta@gmail.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
diff mbox

Patch

diff --git a/disas.c b/disas.c
index 79e6944..a427d18 100644
--- a/disas.c
+++ b/disas.c
@@ -191,7 +191,8 @@  static int print_insn_od_target(bfd_vma pc, disassemble_info *info)
    values:
     i386 - 1 means 16 bit code, 2 means 64 bit code
     arm  - bit 0 = thumb, bit 1 = reverse endian, bit 2 = A64
-    ppc  - nonzero means little endian
+    ppc  - bits 0:15 specify (optionally) the machine instruction set;
+           bit 16 indicates little endian.
     other targets - unused
  */
 void target_disas(FILE *out, CPUArchState *env, target_ulong code,
@@ -251,7 +252,7 @@  void target_disas(FILE *out, CPUArchState *env, target_ulong code,
     s.info.mach = bfd_mach_sparc_v9b;
 #endif
 #elif defined(TARGET_PPC)
-    if (flags >> 16) {
+    if ((flags >> 16) & 1) {
         s.info.endian = BFD_ENDIAN_LITTLE;
     }
     if (flags & 0xFFFF) {