[v2,06/10] Add Aarch64 SVE dwarf regnums
Commit Message
Simply add the Dwarf VG register checks.
This is as per the spec:
https://developer.arm.com/products/architecture/a-profile/docs/100985/0000
2018-06-06 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.
---
gdb/aarch64-tdep.c | 13 ++++++++++++-
gdb/aarch64-tdep.h | 4 ++++
2 files changed, 16 insertions(+), 1 deletion(-)
Comments
On 2018-06-06 11:16 AM, Alan Hayward wrote:
> Simply add the Dwarf VG register checks.
>
> This is as per the spec:
> https://developer.arm.com/products/architecture/a-profile/docs/100985/0000
>
> 2018-06-06 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.
LGTM, thanks.
Simon
@@ -1806,9 +1806,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;
}
-
/* Implement the "print_insn" gdbarch method. */
@@ -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