From a308b89de77e782b563fe5f712397848bfd4a897 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 11 Jul 2020 04:04:08 -0700 Subject: [PATCH] x86: Support GNU_PROPERTY_X86_FEATURE_2_TMM Support GNU_PROPERTY_X86_FEATURE_2_TMM in https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/1 #define GNU_PROPERTY_X86_FEATURE_2_TMM (1U << 10) binutils/ * readelf.c (decode_x86_feature_2): Handle GNU_PROPERTY_X86_FEATURE_2_TMM. gas/ * config/tc-i386.c (output_insn): Check i.xstate to set GNU_PROPERTY_X86_FEATURE_2_TMM. * testsuite/gas/i386/i386.exp: Run x86-64-property-7, x86-64-property-8 and x86-64-property-9. * testsuite/gas/i386/x86-64-property-7.d: New file. * testsuite/gas/i386/x86-64-property-7.s: Likewise. * testsuite/gas/i386/x86-64-property-8.d: Likewise. * testsuite/gas/i386/x86-64-property-8.s: Likewise. * testsuite/gas/i386/x86-64-property-9.d: Likewise. * testsuite/gas/i386/x86-64-property-9.s: Likewise. include/ * elf/common.h (GNU_PROPERTY_X86_FEATURE_2_TMM): New. --- binutils/ChangeLog | 5 +++++ binutils/readelf.c | 3 +++ gas/ChangeLog | 13 +++++++++++++ gas/config/tc-i386.c | 4 ++++ gas/testsuite/gas/i386/i386.exp | 3 +++ gas/testsuite/gas/i386/x86-64-property-7.d | 9 +++++++++ gas/testsuite/gas/i386/x86-64-property-7.s | 2 ++ gas/testsuite/gas/i386/x86-64-property-8.d | 9 +++++++++ gas/testsuite/gas/i386/x86-64-property-8.s | 2 ++ gas/testsuite/gas/i386/x86-64-property-9.d | 9 +++++++++ gas/testsuite/gas/i386/x86-64-property-9.s | 2 ++ include/ChangeLog | 4 ++++ include/elf/common.h | 1 + 13 files changed, 66 insertions(+) create mode 100644 gas/testsuite/gas/i386/x86-64-property-7.d create mode 100644 gas/testsuite/gas/i386/x86-64-property-7.s create mode 100644 gas/testsuite/gas/i386/x86-64-property-8.d create mode 100644 gas/testsuite/gas/i386/x86-64-property-8.s create mode 100644 gas/testsuite/gas/i386/x86-64-property-9.d create mode 100644 gas/testsuite/gas/i386/x86-64-property-9.s diff --git a/binutils/ChangeLog b/binutils/ChangeLog index df8b90e095c..14917c7f574 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2020-07-11 H.J. Lu + + * readelf.c (decode_x86_feature_2): Handle + GNU_PROPERTY_X86_FEATURE_2_TMM. + 2020-07-10 Tom de Vries * dwarf.c (display_debug_lines_decoded): Don't emit meaningless diff --git a/binutils/readelf.c b/binutils/readelf.c index 0feeed9831d..2406304fe35 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -18183,6 +18183,9 @@ decode_x86_feature_2 (unsigned int bitmask) case GNU_PROPERTY_X86_FEATURE_2_ZMM: printf ("ZMM"); break; + case GNU_PROPERTY_X86_FEATURE_2_TMM: + printf ("TMM"); + break; case GNU_PROPERTY_X86_FEATURE_2_FXSR: printf ("FXSR"); break; diff --git a/gas/ChangeLog b/gas/ChangeLog index 003e37d3380..3371d7b8cfc 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,16 @@ +2020-07-11 H.J. Lu + + * config/tc-i386.c (output_insn): Check i.xstate to set + GNU_PROPERTY_X86_FEATURE_2_TMM. + * testsuite/gas/i386/i386.exp: Run x86-64-property-7, + x86-64-property-8 and x86-64-property-9. + * testsuite/gas/i386/x86-64-property-7.d: New file. + * testsuite/gas/i386/x86-64-property-7.s: Likewise. + * testsuite/gas/i386/x86-64-property-8.d: Likewise. + * testsuite/gas/i386/x86-64-property-8.s: Likewise. + * testsuite/gas/i386/x86-64-property-9.d: Likewise. + * testsuite/gas/i386/x86-64-property-9.s: Likewise. + 2020-07-10 H.J. Lu * config/tc-i386.c (_i386_insn): Remove has_regmmx, has_regxmm, diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 0eb2b94e04b..18f685c8b1a 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -9183,6 +9183,10 @@ output_insn (void) x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT; if (i.tm.cpu_flags.bitfield.cpuxsavec) x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_XSAVEC; + + if ((i.xstate & xstate_tmm) == xstate_tmm + || i.tm.cpu_flags.bitfield.cpuamx_tile) + x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_TMM; } #endif diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index ab5620997fc..27a425a7539 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -1217,6 +1217,9 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_dump_test "x86-64-property-4" run_dump_test "x86-64-property-5" run_dump_test "x86-64-property-6" + run_dump_test "x86-64-property-7" + run_dump_test "x86-64-property-8" + run_dump_test "x86-64-property-9" if {[istarget "*-*-linux*"]} then { run_dump_test "x86-64-align-branch-3" diff --git a/gas/testsuite/gas/i386/x86-64-property-7.d b/gas/testsuite/gas/i386/x86-64-property-7.d new file mode 100644 index 00000000000..e938cc90da9 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-property-7.d @@ -0,0 +1,9 @@ +#name: x86-64 property 4 +#as: -mx86-used-note=yes --generate-missing-build-notes=no +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: x86 ISA used: + x86 feature used: x86, TMM diff --git a/gas/testsuite/gas/i386/x86-64-property-7.s b/gas/testsuite/gas/i386/x86-64-property-7.s new file mode 100644 index 00000000000..bfa255b688d --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-property-7.s @@ -0,0 +1,2 @@ + .text + tdpbuud %tmm3, %tmm2, %tmm1 diff --git a/gas/testsuite/gas/i386/x86-64-property-8.d b/gas/testsuite/gas/i386/x86-64-property-8.d new file mode 100644 index 00000000000..e938cc90da9 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-property-8.d @@ -0,0 +1,9 @@ +#name: x86-64 property 4 +#as: -mx86-used-note=yes --generate-missing-build-notes=no +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: x86 ISA used: + x86 feature used: x86, TMM diff --git a/gas/testsuite/gas/i386/x86-64-property-8.s b/gas/testsuite/gas/i386/x86-64-property-8.s new file mode 100644 index 00000000000..23c270b9da0 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-property-8.s @@ -0,0 +1,2 @@ + .text + tilerelease diff --git a/gas/testsuite/gas/i386/x86-64-property-9.d b/gas/testsuite/gas/i386/x86-64-property-9.d new file mode 100644 index 00000000000..e938cc90da9 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-property-9.d @@ -0,0 +1,9 @@ +#name: x86-64 property 4 +#as: -mx86-used-note=yes --generate-missing-build-notes=no +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: x86 ISA used: + x86 feature used: x86, TMM diff --git a/gas/testsuite/gas/i386/x86-64-property-9.s b/gas/testsuite/gas/i386/x86-64-property-9.s new file mode 100644 index 00000000000..14d8c5d041b --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-property-9.s @@ -0,0 +1,2 @@ + .text + tileloaddt1 (%rcx), %tmm5 diff --git a/include/ChangeLog b/include/ChangeLog index 49b9f038fa0..6a69a74b6f4 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2020-07-11 H.J. Lu + + * elf/common.h (GNU_PROPERTY_X86_FEATURE_2_TMM): New. + 2020-07-09 John Baldwin * elf/common.h (AT_FREEBSD_ARGC, AT_FREEBSD_ARGV, AT_FREEBSD_ENVC) diff --git a/include/elf/common.h b/include/elf/common.h index 88dd1c9983b..2138868c9b9 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -846,6 +846,7 @@ #define GNU_PROPERTY_X86_FEATURE_2_XSAVE (1U << 7) #define GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT (1U << 8) #define GNU_PROPERTY_X86_FEATURE_2_XSAVEC (1U << 9) +#define GNU_PROPERTY_X86_FEATURE_2_TMM (1U << 10) /* AArch64 specific GNU PROPERTY. */ #define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000 -- 2.30.2