Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [AARCH64] Fix decoding of neon memory hint insns
@ 2017-10-05 12:40 Jose E. Marchesi
  2017-10-06  9:10 ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Jose E. Marchesi @ 2017-10-05 12:40 UTC (permalink / raw)
  To: gdb-patches


Hi guys!

Today I got this error building GDB with the latest svn GCC:

../../gdb/arm-tdep.c: In function ‘int arm_decode_misc_memhint_neon(gdbarch*, uint32_t, regcache*, displaced_step_closure*)’:
../../gdb/arm-tdep.c:6411:52: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
   else if (op1 == 0x10 && op2 == 0x0 && (rn & 0xe) == 0x1)

I believe the patch below does the right thing.  According to the ARM
ARM, bits 19..16 are 0001 for SETEND and iim1 (where ii is immod and m
is mmod) for CPS.

commit 821015b19fa66f01d707695309486262351e1e5b
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Thu Oct 5 12:33:19 2017 +0000

    gdb: Fix decoding of ARM neon memory hint insns
    
    gdb/ChangeLog:
    
    2017-10-05  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
            * arm-tdep.c (arm_decode_misc_memhint_neon): Fix decoding of CPS
            and SETEND.

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 2709321..d8569e0 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -6406,9 +6406,9 @@ arm_decode_misc_memhint_neon (struct gdbarch *gdbarch, uint32_t insn,
   unsigned int op1 = bits (insn, 20, 26), op2 = bits (insn, 4, 7);
   unsigned int rn = bits (insn, 16, 19);
 
-  if (op1 == 0x10 && (op2 & 0x2) == 0x0 && (rn & 0xe) == 0x0)
+  if (op1 == 0x10 && (op2 & 0x2) == 0x0 && (rn & 0x1) == 0x0)
     return arm_copy_unmodified (gdbarch, insn, "cps", dsc);
-  else if (op1 == 0x10 && op2 == 0x0 && (rn & 0xe) == 0x1)
+  else if (op1 == 0x10 && op2 == 0x0 && (rn & 0x1) == 0x1)
     return arm_copy_unmodified (gdbarch, insn, "setend", dsc);
   else if ((op1 & 0x60) == 0x20)
     return arm_copy_unmodified (gdbarch, insn, "neon dataproc", dsc);


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-06  9:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 12:40 [PATCH] [AARCH64] Fix decoding of neon memory hint insns Jose E. Marchesi
2017-10-06  9:10 ` Yao Qi
2017-10-06  9:52   ` Jose E. Marchesi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox