public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [AArch64] Fix incorrect mask when decoding b.cond instruction
@ 2015-09-11  9:20 Pierre Langlois
  2015-09-11 15:35 ` Yao Qi
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Langlois @ 2015-09-11  9:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pierre Langlois

Hi all,

The encoding of the b.cond instruction is described in the architecture
reference manual as:

b.cond  0101 0100 iiii iiii iiii iiii iii0 cccc

So the mask should be 0xff000010.

I've regression tested it on aarch64-linux, I haven't seen any difference
with or without the patch.

Thanks,
Pierre

gdb/ChangeLog:

	* aarch64-tdep.c (decode_bcond): Fix incorrect mask.
---
 gdb/aarch64-tdep.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 9a44446..a4d8186 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -339,7 +339,8 @@ decode_b (CORE_ADDR addr, uint32_t insn, int *is_bl, int32_t *offset)
 static int
 decode_bcond (CORE_ADDR addr, uint32_t insn, unsigned *cond, int32_t *offset)
 {
-  if (decode_masked_match (insn, 0xfe000000, 0x54000000))
+  /* b.cond  0101 0100 iiii iiii iiii iiii iii0 cccc */
+  if (decode_masked_match (insn, 0xff000010, 0x54000000))
     {
       *cond = (insn >> 0) & 0xf;
       *offset = extract_signed_bitfield (insn, 19, 5) << 2;
-- 
2.4.6

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] [AArch64] Fix incorrect mask when decoding b.cond instruction
@ 2015-08-17 13:29 Pierre Langlois
  2015-08-19  8:32 ` Yao Qi
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Langlois @ 2015-08-17 13:29 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pierre Langlois

Hi all,

The encoding of the b.cond instruction is described in the architecture
reference manual as:

b.cond  0101 0100 iiii iiii iiii iiii iii0 cccc

So the mask should be 0xff000010.

Thanks,
Pierre

gdb/ChangeLog:

	* aarch64-tdep.c (decode_bcond): Fix incorrect mask.
---
 gdb/aarch64-tdep.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index c722dc5..e065378 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -339,7 +339,8 @@ decode_b (CORE_ADDR addr, uint32_t insn, int *is_bl, int32_t *offset)
 static int
 decode_bcond (CORE_ADDR addr, uint32_t insn, unsigned *cond, int32_t *offset)
 {
-  if (decode_masked_match (insn, 0xfe000000, 0x54000000))
+  /* b.cond  0101 0100 iiii iiii iiii iiii iii0 cccc */
+  if (decode_masked_match (insn, 0xff000010, 0x54000000))
     {
       *cond = (insn >> 0) & 0xf;
       *offset = extract_signed_bitfield (insn, 19, 5) << 2;
-- 
2.4.6

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

end of thread, other threads:[~2015-09-11 15:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-11  9:20 [PATCH] [AArch64] Fix incorrect mask when decoding b.cond instruction Pierre Langlois
2015-09-11 15:35 ` Yao Qi
2015-09-11 15:52   ` Pierre Langlois
  -- strict thread matches above, loose matches on Subject: below --
2015-08-17 13:29 Pierre Langlois
2015-08-19  8:32 ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).