Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: jose.marchesi@oracle.com (Jose E. Marchesi)
To: gdb-patches@sourceware.org
Subject: [PATCH] [AARCH64] Fix decoding of neon memory hint insns
Date: Thu, 05 Oct 2017 12:40:00 -0000	[thread overview]
Message-ID: <87mv55ahuk.fsf@oracle.com> (raw)


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);


             reply	other threads:[~2017-10-05 12:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 12:40 Jose E. Marchesi [this message]
2017-10-06  9:10 ` Yao Qi
2017-10-06  9:52   ` Jose E. Marchesi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mv55ahuk.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox