Add Aarch64 SVE dwarf regnums
authorAlan Hayward <alan.hayward@arm.com>
Mon, 11 Jun 2018 09:24:20 +0000 (10:24 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Mon, 11 Jun 2018 09:24:20 +0000 (10:24 +0100)
This is as per the spec:
https://developer.arm.com/products/architecture/a-profile/docs/100985/0000

gdb/
* aarch64-tdep.c (aarch64_dwarf_reg_to_regnum): Add mappings.
* aarch64-tdep.h (AARCH64_DWARF_SVE_VG): Add define.
(AARCH64_DWARF_SVE_FFR): Likewise.
(AARCH64_DWARF_SVE_P0): Likewise.
(AARCH64_DWARF_SVE_Z0): Likewise.

gdb/ChangeLog
gdb/aarch64-tdep.c
gdb/aarch64-tdep.h

index 3e51f87d0553c51727e305695f74d552df0fdfd8..635f02523b113666cabe041127bc9d165a98e561 100644 (file)
@@ -1,3 +1,11 @@
+2018-06-11  Alan Hayward  <alan.hayward@arm.com>
+
+       * aarch64-tdep.c (aarch64_dwarf_reg_to_regnum): Add mappings.
+       * aarch64-tdep.h (AARCH64_DWARF_SVE_VG): Add define.
+       (AARCH64_DWARF_SVE_FFR): Likewise.
+       (AARCH64_DWARF_SVE_P0): Likewise.
+       (AARCH64_DWARF_SVE_Z0): Likewise.
+
 2018-06-11  Alan Hayward  <alan.hayward@arm.com>
 
        * common/common-regcache.h (raw_compare): New function.
index 5380baab9e11435dc2a534508f963b52a4a58d95..5120fffe776ada9fc5670ff4759c8e53378a8193 100644 (file)
@@ -1805,9 +1805,20 @@ aarch64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
   if (reg >= AARCH64_DWARF_V0 && reg <= AARCH64_DWARF_V0 + 31)
     return AARCH64_V0_REGNUM + reg - AARCH64_DWARF_V0;
 
+  if (reg == AARCH64_DWARF_SVE_VG)
+    return AARCH64_SVE_VG_REGNUM;
+
+  if (reg == AARCH64_DWARF_SVE_FFR)
+    return AARCH64_SVE_FFR_REGNUM;
+
+  if (reg >= AARCH64_DWARF_SVE_P0 && reg <= AARCH64_DWARF_SVE_P0 + 15)
+    return AARCH64_SVE_P0_REGNUM + reg - AARCH64_DWARF_SVE_P0;
+
+  if (reg >= AARCH64_DWARF_SVE_Z0 && reg <= AARCH64_DWARF_SVE_Z0 + 15)
+    return AARCH64_SVE_Z0_REGNUM + reg - AARCH64_DWARF_SVE_Z0;
+
   return -1;
 }
-\f
 
 /* Implement the "print_insn" gdbarch method.  */
 
index 5a319551e6bb16f4768fb31ab160020823c6f487..7e5031f0fd5f09ac46fc8092f4a58dcf91562edf 100644 (file)
@@ -32,6 +32,10 @@ struct regset;
 #define AARCH64_DWARF_X0   0
 #define AARCH64_DWARF_SP  31
 #define AARCH64_DWARF_V0  64
+#define AARCH64_DWARF_SVE_VG   46
+#define AARCH64_DWARF_SVE_FFR  47
+#define AARCH64_DWARF_SVE_P0   48
+#define AARCH64_DWARF_SVE_Z0   96
 
 /* Size of integer registers.  */
 #define X_REGISTER_SIZE  8