summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
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/gdbarch.h
parent1347d111096835049841f2039a4d5852404606a3 (diff)
downloadbinutils-gdb-2a67f09db1b70bf55fa88cf2dbb6755210e0e218.tar.gz
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/gdbarch.h')
-rw-r--r--gdb/gdbarch.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 7a3060e628d..87e55fa72b9 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -158,12 +158,18 @@ extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
-/* The ABI default bit-size and format for "half", "float", "double", and
+/* The ABI default bit-size and format for "bfloat16", "half", "float", "double", and
"long double". These bit/format pairs should eventually be combined
into a single object. For the moment, just initialize them as a pair.
Each format describes both the big and little endian layouts (if
useful). */
+extern int gdbarch_bfloat16_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_bfloat16_bit (struct gdbarch *gdbarch, int bfloat16_bit);
+
+extern const struct floatformat ** gdbarch_bfloat16_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_bfloat16_format (struct gdbarch *gdbarch, const struct floatformat ** bfloat16_format);
+
extern int gdbarch_half_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_half_bit (struct gdbarch *gdbarch, int half_bit);