aboutsummaryrefslogtreecommitdiff
path: root/gdb/aarch64-tdep.c
diff options
context:
space:
mode:
authorSrinath Parvathaneni <srinath.parvathaneni@arm.com>2021-01-12 13:57:23 +0000
committerSrinath Parvathaneni <srinath.parvathaneni@arm.com>2021-01-12 14:03:58 +0000
commit5291fe3cd14f2861fad43303a10550e71dc14182 (patch)
tree80ab70388403d31b63df0fcc67a505e059164c7c /gdb/aarch64-tdep.c
parentd546b61084cec687e0063b2e0e169b4690341c23 (diff)
downloadfsf-binutils-gdb-5291fe3cd14f2861fad43303a10550e71dc14182.zip
fsf-binutils-gdb-5291fe3cd14f2861fad43303a10550e71dc14182.tar.gz
fsf-binutils-gdb-5291fe3cd14f2861fad43303a10550e71dc14182.tar.bz2
aarch64: Add support for bfloat16 in gdb.
This patch adds support for bfloat16 in AArch64 gdb. Also adds the field "bf" to vector registers h0-h31. Also adds the vector "bf" to h field in vector registers v0-v31. The following is how the vector register h and v looks like. Before this patch: (gdb) p $h0 $1 = {f = 0, u = 0, s = 0} (gdb) p/x $h0 $2 = {f = 0x0, u = 0x0, s = 0x0} (gdb) p $v0.h $3 = {f = {0, 0, 0, 0, 0, 0, 0, 0}, u = {0, 0, 0, 0, 0, 0, 0, 0}, s = {0, 0, 0, 0, 0, 0, 0, 0}} (gdb) p/x $v0.h $4 = {f = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, s = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} After this patch: (gdb) p $h0 $1 = {bf = 0, f = 0, u = 0, s = 0} (gdb) p/x $h0 $2 = {bf = 0x0, f = 0x0, u = 0x0, s = 0x0} (gdb) p $v0.h $3 = {bf = {0, 0, 0, 0, 0, 0, 0, 0}, f = {0, 0, 0, 0, 0, 0, 0, 0}, u = {0, 0, 0, 0, 0, 0, 0, 0}, s = {0, 0, 0, 0, 0, 0, 0, 0}} (gdb) p/x $v0.h $4 = {bf = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, f = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, s = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} gdb/ChangeLog: 2021-01-12 Srinath Parvathaneni <srinath.parvathaneni@arm.com> * aarch64-tdep.c (aarch64_vnh_type): Add "bf" field in h registers. (aarch64_vnv_type): Add "bf" type in h field of v registers. * features/aarch64-fpu.c (create_feature_aarch64_fpu): Regenerated. * features/aarch64-fpu.xml: Add bfloat16 type. gdb/testsuite/ChangeLog: 2021-01-12 Srinath Parvathaneni <srinath.parvathaneni@arm.com> * gdb.arch/aarch64-fp.exp: Modify to test bfloat16 support.
Diffstat (limited to 'gdb/aarch64-tdep.c')
-rw-r--r--gdb/aarch64-tdep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 5d1d979..7099f18 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -2040,6 +2040,9 @@ aarch64_vnh_type (struct gdbarch *gdbarch)
t = arch_composite_type (gdbarch, "__gdb_builtin_type_vnh",
TYPE_CODE_UNION);
+ elem = builtin_type (gdbarch)->builtin_bfloat16;
+ append_composite_type_field (t, "bf", elem);
+
elem = builtin_type (gdbarch)->builtin_half;
append_composite_type_field (t, "f", elem);
@@ -2121,6 +2124,8 @@ aarch64_vnv_type (struct gdbarch *gdbarch)
sub = arch_composite_type (gdbarch, "__gdb_builtin_type_vnh",
TYPE_CODE_UNION);
+ append_composite_type_field (sub, "bf",
+ init_vector_type (bt->builtin_bfloat16, 8));
append_composite_type_field (sub, "f",
init_vector_type (bt->builtin_half, 8));
append_composite_type_field (sub, "u",