mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
2a67f09db1
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.
90 lines
4.1 KiB
C
90 lines
4.1 KiB
C
/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
|
|
Original: 64bit-sse.xml */
|
|
|
|
#include "gdbsupport/tdesc.h"
|
|
|
|
static int
|
|
create_feature_i386_64bit_sse (struct target_desc *result, long regnum)
|
|
{
|
|
struct tdesc_feature *feature;
|
|
|
|
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse");
|
|
tdesc_type *element_type;
|
|
element_type = tdesc_named_type (feature, "bfloat16");
|
|
tdesc_create_vector (feature, "v8bf16", element_type, 8);
|
|
|
|
element_type = tdesc_named_type (feature, "ieee_single");
|
|
tdesc_create_vector (feature, "v4f", element_type, 4);
|
|
|
|
element_type = tdesc_named_type (feature, "ieee_double");
|
|
tdesc_create_vector (feature, "v2d", element_type, 2);
|
|
|
|
element_type = tdesc_named_type (feature, "int8");
|
|
tdesc_create_vector (feature, "v16i8", element_type, 16);
|
|
|
|
element_type = tdesc_named_type (feature, "int16");
|
|
tdesc_create_vector (feature, "v8i16", element_type, 8);
|
|
|
|
element_type = tdesc_named_type (feature, "int32");
|
|
tdesc_create_vector (feature, "v4i32", element_type, 4);
|
|
|
|
element_type = tdesc_named_type (feature, "int64");
|
|
tdesc_create_vector (feature, "v2i64", element_type, 2);
|
|
|
|
tdesc_type_with_fields *type_with_fields;
|
|
type_with_fields = tdesc_create_union (feature, "vec128");
|
|
tdesc_type *field_type;
|
|
field_type = tdesc_named_type (feature, "v8bf16");
|
|
tdesc_add_field (type_with_fields, "v8_bfloat16", field_type);
|
|
field_type = tdesc_named_type (feature, "v4f");
|
|
tdesc_add_field (type_with_fields, "v4_float", field_type);
|
|
field_type = tdesc_named_type (feature, "v2d");
|
|
tdesc_add_field (type_with_fields, "v2_double", field_type);
|
|
field_type = tdesc_named_type (feature, "v16i8");
|
|
tdesc_add_field (type_with_fields, "v16_int8", field_type);
|
|
field_type = tdesc_named_type (feature, "v8i16");
|
|
tdesc_add_field (type_with_fields, "v8_int16", field_type);
|
|
field_type = tdesc_named_type (feature, "v4i32");
|
|
tdesc_add_field (type_with_fields, "v4_int32", field_type);
|
|
field_type = tdesc_named_type (feature, "v2i64");
|
|
tdesc_add_field (type_with_fields, "v2_int64", field_type);
|
|
field_type = tdesc_named_type (feature, "uint128");
|
|
tdesc_add_field (type_with_fields, "uint128", field_type);
|
|
|
|
type_with_fields = tdesc_create_flags (feature, "i386_mxcsr", 4);
|
|
tdesc_add_flag (type_with_fields, 0, "IE");
|
|
tdesc_add_flag (type_with_fields, 1, "DE");
|
|
tdesc_add_flag (type_with_fields, 2, "ZE");
|
|
tdesc_add_flag (type_with_fields, 3, "OE");
|
|
tdesc_add_flag (type_with_fields, 4, "UE");
|
|
tdesc_add_flag (type_with_fields, 5, "PE");
|
|
tdesc_add_flag (type_with_fields, 6, "DAZ");
|
|
tdesc_add_flag (type_with_fields, 7, "IM");
|
|
tdesc_add_flag (type_with_fields, 8, "DM");
|
|
tdesc_add_flag (type_with_fields, 9, "ZM");
|
|
tdesc_add_flag (type_with_fields, 10, "OM");
|
|
tdesc_add_flag (type_with_fields, 11, "UM");
|
|
tdesc_add_flag (type_with_fields, 12, "PM");
|
|
tdesc_add_flag (type_with_fields, 15, "FZ");
|
|
|
|
regnum = 40;
|
|
tdesc_create_reg (feature, "xmm0", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm1", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm2", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm3", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm4", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm5", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm6", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm7", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm8", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm9", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm10", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm11", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm12", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm13", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm14", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "xmm15", regnum++, 1, NULL, 128, "vec128");
|
|
tdesc_create_reg (feature, "mxcsr", regnum++, 1, "vector", 32, "i386_mxcsr");
|
|
return regnum;
|
|
}
|