This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] [AArch64] Cleanup comments in instruction decoding functions


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=669e74e8295e8aef1dc052f30ff30bad624eb0f6

commit 669e74e8295e8aef1dc052f30ff30bad624eb0f6
Author: Pierre Langlois <pierre.langlois@arm.com>
Date:   Fri Sep 11 17:00:55 2015 +0100

    [AArch64] Cleanup comments in instruction decoding functions
    
    gdb/ChangeLog:
    
    	* aarch64-tdep.c (decode_cb): Move up comment describing the
    	encoding.
    	(decode_tb): Fix a typo in comment above the function.  Move up
    	comment describing the encoding.

Diff:
---
 gdb/ChangeLog      |  7 +++++++
 gdb/aarch64-tdep.c | 12 +++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0942986..d7a8d31 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
 2015-09-11  Pierre Langlois  <pierre.langlois@arm.com>
 
+	* aarch64-tdep.c (decode_cb): Move up comment describing the
+	encoding.
+	(decode_tb): Fix a typo in comment above the function.  Move up
+	comment describing the encoding.
+
+2015-09-11  Pierre Langlois  <pierre.langlois@arm.com>
+
 	* aarch64-tdep.c (decode_bcond): Fix incorrect mask.
 
 2015-09-11  Mihail-Marian Nistor  <mihail.nistor@freescale.com>
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index a4d8186..2ac1a49 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -401,11 +401,10 @@ static int
 decode_cb (CORE_ADDR addr, uint32_t insn, int *is64, int *is_cbnz,
 	   unsigned *rn, int32_t *offset)
 {
+  /* cbz  T011 010o iiii iiii iiii iiii iiir rrrr */
+  /* cbnz T011 010o iiii iiii iiii iiii iiir rrrr */
   if (decode_masked_match (insn, 0x7e000000, 0x34000000))
     {
-      /* cbz  T011 010o iiii iiii iiii iiii iiir rrrr */
-      /* cbnz T011 010o iiii iiii iiii iiii iiir rrrr */
-
       *rn = (insn >> 0) & 0x1f;
       *is64 = (insn >> 31) & 0x1;
       *is_cbnz = (insn >> 24) & 0x1;
@@ -628,7 +627,7 @@ decode_stur (CORE_ADDR addr, uint32_t insn, int *is64, unsigned *rt,
   return 0;
 }
 
-/* Decode an opcode if it represents a TB or TBNZ instruction.
+/* Decode an opcode if it represents a TBZ or TBNZ instruction.
 
    ADDR specifies the address of the opcode.
    INSN specifies the opcode to test.
@@ -643,11 +642,10 @@ static int
 decode_tb (CORE_ADDR addr, uint32_t insn, int *is_tbnz, unsigned *bit,
 	   unsigned *rt, int32_t *imm)
 {
+  /* tbz  b011 0110 bbbb biii iiii iiii iiir rrrr */
+  /* tbnz B011 0111 bbbb biii iiii iiii iiir rrrr */
   if (decode_masked_match (insn, 0x7e000000, 0x36000000))
     {
-      /* tbz  b011 0110 bbbb biii iiii iiii iiir rrrr */
-      /* tbnz B011 0111 bbbb biii iiii iiii iiir rrrr */
-
       *rt = (insn >> 0) & 0x1f;
       *is_tbnz = (insn >> 24) & 0x1;
       *bit = ((insn >> (31 - 4)) & 0x20) | ((insn >> 19) & 0x1f);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]