aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorFelix Willgerodt <felix.willgerodt@intel.com>2020-09-10 14:29:53 +0200
committerKevin Buettner <kevinb@redhat.com>2020-09-11 11:42:47 -0700
commit2a67f09db1b70bf55fa88cf2dbb6755210e0e218 (patch)
treed8e892091e998a3e0a7c96116ddb42cfdd688d16 /gdb/i386-tdep.c
parent1347d111096835049841f2039a4d5852404606a3 (diff)
downloadgdb-2a67f09db1b70bf55fa88cf2dbb6755210e0e218.zip
gdb-2a67f09db1b70bf55fa88cf2dbb6755210e0e218.tar.gz
gdb-2a67f09db1b70bf55fa88cf2dbb6755210e0e218.tar.bz2
Add bfloat16 support for AVX512 register view.
This adds support for the bfloat16 datatype, which can be seen as a short version of FP32, skipping the least significant 16 bits of the mantissa. Since the datatype is currently only supported by the AVX512 registers, the printing of bfloat16 values is only supported for xmm, ymm and zmm registers. gdb/ChangeLog: 2020-09-11 Moritz Riesterer <moritz.riesterer@intel.com> Felix Willgerodt <Felix.Willgerodt@intel.com> * gdbarch.sh: Added bfloat16 type. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * gdbtypes.c (floatformats_bfloat16): New struct. (gdbtypes_post_init): Add builtin_bfloat16. * gdbtypes.h (struct builtin_type) <builtin_bfloat16>: New member. (floatformats_bfloat16): New struct. * i386-tdep.c (i386_zmm_type): Add field "v32_bfloat16" (i386_ymm_type): Add field "v16_bfloat16" (i386_gdbarch_init): Add set_gdbarch_bfloat16_format. * target-descriptions.c (make_gdb_type): Add case TDESC_TYPE_BFLOAT16. * gdbsupport/tdesc.cc (tdesc_predefined_types): New member bfloat16. * gdbsupport/tdesc.h (tdesc_type_kind): New member TDESC_TYPE_BFLOAT16. * features/i386/64bit-avx512.xml: Add bfloat16 type. * features/i386/64bit-avx512.c: Regenerated. * features/i386/64bit-sse.xml: Add bfloat16 type. * features/i386/64bit-sse.c: Regenerated. gdb/testsuite/ChangeLog: 2020-09-11 Moritz Riesterer <moritz.riesterer@intel.com> Felix Willgerodt <Felix.Willgerodt@intel.com> * x86-avx512bf16.c: New file. * x86-avx512bf16.exp: Likewise. * lib/gdb.exp (skip_avx512bf16_tests): New function.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 322d2a4..1b7971c 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -3112,6 +3112,7 @@ i386_zmm_type (struct gdbarch *gdbarch)
int8_t v64_int8[64];
double v8_double[8];
float v16_float[16];
+ bfloat16_t v32_bfloat16[32];
};
#endif
@@ -3119,6 +3120,8 @@ i386_zmm_type (struct gdbarch *gdbarch)
t = arch_composite_type (gdbarch,
"__gdb_builtin_type_vec512i", TYPE_CODE_UNION);
+ append_composite_type_field (t, "v32_bfloat16",
+ init_vector_type (bt->builtin_bfloat16, 32));
append_composite_type_field (t, "v16_float",
init_vector_type (bt->builtin_float, 16));
append_composite_type_field (t, "v8_double",
@@ -3165,6 +3168,7 @@ i386_ymm_type (struct gdbarch *gdbarch)
int8_t v32_int8[32];
double v4_double[4];
float v8_float[8];
+ bfloat16_t v16_bfloat16[16];
};
#endif
@@ -3172,6 +3176,8 @@ i386_ymm_type (struct gdbarch *gdbarch)
t = arch_composite_type (gdbarch,
"__gdb_builtin_type_vec256i", TYPE_CODE_UNION);
+ append_composite_type_field (t, "v16_bfloat16",
+ init_vector_type (bt->builtin_bfloat16, 16));
append_composite_type_field (t, "v8_float",
init_vector_type (bt->builtin_float, 8));
append_composite_type_field (t, "v4_double",
@@ -8487,6 +8493,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
alignment. */
set_gdbarch_long_double_bit (gdbarch, 96);
+ /* Support of bfloat16 format. */
+ set_gdbarch_bfloat16_format (gdbarch, floatformats_bfloat16);
+
/* Support for floating-point data type variants. */
set_gdbarch_floatformat_for_type (gdbarch, i386_floatformat_for_type);