Add bfloat16 support for AVX512 register view.
authorFelix Willgerodt <felix.willgerodt@intel.com>
Thu, 10 Sep 2020 12:29:53 +0000 (14:29 +0200)
committerKevin Buettner <kevinb@redhat.com>
Fri, 11 Sep 2020 18:42:47 +0000 (11:42 -0700)
commit2a67f09db1b70bf55fa88cf2dbb6755210e0e218
treed8e892091e998a3e0a7c96116ddb42cfdd688d16
parent1347d111096835049841f2039a4d5852404606a3
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.
18 files changed:
gdb/ChangeLog
gdb/features/i386/64bit-avx512.c
gdb/features/i386/64bit-avx512.xml
gdb/features/i386/64bit-sse.c
gdb/features/i386/64bit-sse.xml
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/i386-tdep.c
gdb/target-descriptions.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/x86-avx512bf16.c [new file with mode: 0644]
gdb/testsuite/gdb.arch/x86-avx512bf16.exp [new file with mode: 0644]
gdb/testsuite/lib/gdb.exp
gdbsupport/tdesc.cc
gdbsupport/tdesc.h