]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: Support GNU_PROPERTY_X86_FEATURE_2_TMM
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 11 Jul 2020 11:04:08 +0000 (04:04 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 11 Jul 2020 11:04:20 +0000 (04:04 -0700)
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.

13 files changed:
binutils/ChangeLog
binutils/readelf.c
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/x86-64-property-7.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-property-7.s [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-property-8.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-property-8.s [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-property-9.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-property-9.s [new file with mode: 0644]
include/ChangeLog
include/elf/common.h

index df8b90e095c0c116b61181b477bcc70bf3b4c0bd..14917c7f574edd573ce439af0962174b8916153d 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * readelf.c (decode_x86_feature_2): Handle
+       GNU_PROPERTY_X86_FEATURE_2_TMM.
+
 2020-07-10  Tom de Vries  <tdevries@suse.de>
 
        * dwarf.c (display_debug_lines_decoded): Don't emit meaningless
index 0feeed9831d2500cd2117611062c4c127e2e591b..2406304fe35a832ac53aa7b1a367f3f7afed4264 100644 (file)
@@ -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;
index 003e37d3380e431739e475be4c65686ee352d86a..3371d7b8cfcaa7d419f0a62bae010643a3f3eb72 100644 (file)
@@ -1,3 +1,16 @@
+2020-07-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * 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  <hongjiu.lu@intel.com>
 
        * config/tc-i386.c (_i386_insn): Remove has_regmmx, has_regxmm,
index 0eb2b94e04b299caffebf32d7b63e9899ce40d3e..18f685c8b1a7c1bff575db35e08e9938a7ded926 100644 (file)
@@ -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
 
index ab5620997fc3f301d8a6ff0ae2130a50d68d4d49..27a425a7539aa880c9f45439487c7eae509af80a 100644 (file)
@@ -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 (file)
index 0000000..e938cc9
--- /dev/null
@@ -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: <None>
+       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 (file)
index 0000000..bfa255b
--- /dev/null
@@ -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 (file)
index 0000000..e938cc9
--- /dev/null
@@ -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: <None>
+       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 (file)
index 0000000..23c270b
--- /dev/null
@@ -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 (file)
index 0000000..e938cc9
--- /dev/null
@@ -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: <None>
+       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 (file)
index 0000000..14d8c5d
--- /dev/null
@@ -0,0 +1,2 @@
+       .text
+       tileloaddt1 (%rcx), %tmm5
index 49b9f038fa0c834b1bacc80f5942714feb3497aa..6a69a74b6f4c6845c3ac2baf14d4f7ad76ab7ed9 100644 (file)
@@ -1,3 +1,7 @@
+2020-07-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf/common.h (GNU_PROPERTY_X86_FEATURE_2_TMM): New.
+
 2020-07-09  John Baldwin  <jhb@FreeBSD.org>
 
        * elf/common.h (AT_FREEBSD_ARGC, AT_FREEBSD_ARGV, AT_FREEBSD_ENVC)
index 88dd1c9983bda8605a744f2d517041f751e2d8ba..2138868c9b90a82a04af6bb63057a201a47ce610 100644 (file)
 #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