aboutsummaryrefslogtreecommitdiff
path: root/gdb/arch
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2018-05-31 14:36:48 +0100
committerAlan Hayward <alan.hayward@arm.com>2018-05-31 14:36:48 +0100
commit122394f1476b1c925a281b15399119500c8231c1 (patch)
treeeeacb0f62658c8cf48d8b300b729090337b837b1 /gdb/arch
parent95228a0d790f16deae3436e18f41b70fc711a5b2 (diff)
downloadgdb-122394f1476b1c925a281b15399119500c8231c1.zip
gdb-122394f1476b1c925a281b15399119500c8231c1.tar.gz
gdb-122394f1476b1c925a281b15399119500c8231c1.tar.bz2
Function for reading the Aarch64 SVE vector length
Returns 0 for systems without SVE support. Note the defines taken from Linux kernel headers in aarch64-sve-linux-ptrace.h. gdb/ * Makefile.in: Add new header. * gdb/arch/aarch64.h (sve_vg_from_vl): New macro. (sve_vl_from_vg): Likewise. (sve_vq_from_vl): Likewise. (sve_vl_from_vq): Likewise. (sve_vq_from_vg): Likewise. (sve_vg_from_vq): Likewise. * configure.nat: Add new c file. * nat/aarch64-sve-linux-ptrace.c: New file. * nat/aarch64-sve-linux-ptrace.h: New file. gdbserver/ * configure.srv: Add new c/h file.
Diffstat (limited to 'gdb/arch')
-rw-r--r--gdb/arch/aarch64.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h
index b291a09..2f80a29 100644
--- a/gdb/arch/aarch64.h
+++ b/gdb/arch/aarch64.h
@@ -52,6 +52,23 @@ enum aarch64_regnum
#define AARCH64_V_REGS_NUM 32
#define AARCH64_NUM_REGS AARCH64_FPCR_REGNUM + 1
+/* There are a number of ways of expressing the current SVE vector size:
+
+ VL : Vector Length.
+ The number of bytes in an SVE Z register.
+ VQ : Vector Quotient.
+ The number of 128bit chunks in an SVE Z register.
+ VG : Vector Gradient.
+ The number of 64bit chunks in an SVE Z register. */
+
+#define sve_vg_from_vl(vl) ((vl) / 8)
+#define sve_vl_from_vg(vg) ((vg) * 8)
+#define sve_vq_from_vl(vl) ((vl) / 0x10)
+#define sve_vl_from_vq(vq) ((vq) * 0x10)
+#define sve_vq_from_vg(vg) (sve_vq_from_vl (sve_vl_from_vg (vg)))
+#define sve_vg_from_vq(vq) (sve_vg_from_vl (sve_vl_from_vq (vq)))
+
+
/* Maximum supported VQ value. Increase if required. */
#define AARCH64_MAX_SVE_VQ 16