aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-07-09 10:33:25 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-07-09 10:33:43 -0700
commit39776b1117bdbdc34eb46151edc8e09eecce1530 (patch)
tree15716b073961fbec542d624a6830a9af24b89253 /gas
parentfc238d4a066cdb1a979475ffdf5bd45cdb8a00f0 (diff)
downloadgdb-39776b1117bdbdc34eb46151edc8e09eecce1530.zip
gdb-39776b1117bdbdc34eb46151edc8e09eecce1530.tar.gz
gdb-39776b1117bdbdc34eb46151edc8e09eecce1530.tar.bz2
x86: Properly set YMM/ZMM features
Since VEX/EVEX vector instructions will always update the full YMM/ZMM registers, set YMM/ZMM features for VEX/EVEX vector instructions. * config/tc-i386.c (output_insn): Set YMM/ZMM features for VEX/EVEX vector instructions. * testsuite/gas/i386/property-4.d: New file. * testsuite/gas/i386/property-4.s: Likewise. * testsuite/gas/i386/property-5.d: Likewise. * testsuite/gas/i386/property-5.s: Likewise. * testsuite/gas/i386/x86-64-property-4.d: Likewise. * testsuite/gas/i386/x86-64-property-5.d: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog11
-rw-r--r--gas/config/tc-i386.c9
-rw-r--r--gas/testsuite/gas/i386/i386.exp4
-rw-r--r--gas/testsuite/gas/i386/property-4.d9
-rw-r--r--gas/testsuite/gas/i386/property-4.s2
-rw-r--r--gas/testsuite/gas/i386/property-5.d9
-rw-r--r--gas/testsuite/gas/i386/property-5.s2
-rw-r--r--gas/testsuite/gas/i386/x86-64-property-4.d10
-rw-r--r--gas/testsuite/gas/i386/x86-64-property-5.d10
9 files changed, 64 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 5a713bc..19b17c1 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,16 @@
2020-07-09 H.J. Lu <hongjiu.lu@intel.com>
+ * config/tc-i386.c (output_insn): Set YMM/ZMM features for
+ VEX/EVEX vector instructions.
+ * testsuite/gas/i386/property-4.d: New file.
+ * testsuite/gas/i386/property-4.s: Likewise.
+ * testsuite/gas/i386/property-5.d: Likewise.
+ * testsuite/gas/i386/property-5.s: Likewise.
+ * testsuite/gas/i386/x86-64-property-4.d: Likewise.
+ * testsuite/gas/i386/x86-64-property-5.d: Likewise.
+
+2020-07-09 H.J. Lu <hongjiu.lu@intel.com>
+
* NEWS: Mention --enable-x86-used-note.
* configure.ac: Configure with --enable-x86-used-note by default
for Linux/x86.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 2e0eb24..bb51133 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -9120,9 +9120,14 @@ output_insn (void)
x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_MMX;
if (i.has_regxmm)
x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_XMM;
- if (i.has_regymm)
+ if (i.has_regymm
+ || (i.has_regxmm
+ && (i.tm.opcode_modifier.vex
+ || i.tm.opcode_modifier.evex)))
x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_YMM;
- if (i.has_regzmm)
+ if (i.has_regzmm
+ || ((i.has_regxmm || i.has_regymm)
+ && i.tm.opcode_modifier.evex))
x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_ZMM;
if (i.tm.cpu_flags.bitfield.cpufxsr)
x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_FXSR;
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 37aa396..0074a13 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -622,6 +622,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "property-1"
run_dump_test "property-2"
run_dump_test "property-3"
+ run_dump_test "property-4"
+ run_dump_test "property-5"
if {[istarget "*-*-linux*"]} then {
run_dump_test "align-branch-3"
@@ -1207,6 +1209,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-property-1"
run_dump_test "x86-64-property-2"
run_dump_test "x86-64-property-3"
+ run_dump_test "x86-64-property-4"
+ run_dump_test "x86-64-property-5"
if {[istarget "*-*-linux*"]} then {
run_dump_test "x86-64-align-branch-3"
diff --git a/gas/testsuite/gas/i386/property-4.d b/gas/testsuite/gas/i386/property-4.d
new file mode 100644
index 0000000..0fe6bc7
--- /dev/null
+++ b/gas/testsuite/gas/i386/property-4.d
@@ -0,0 +1,9 @@
+#name: i386 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: AVX
+ x86 feature used: x86, XMM, YMM
diff --git a/gas/testsuite/gas/i386/property-4.s b/gas/testsuite/gas/i386/property-4.s
new file mode 100644
index 0000000..dcc2882
--- /dev/null
+++ b/gas/testsuite/gas/i386/property-4.s
@@ -0,0 +1,2 @@
+ .text
+ {vex} vmovaps %xmm0, %xmm0
diff --git a/gas/testsuite/gas/i386/property-5.d b/gas/testsuite/gas/i386/property-5.d
new file mode 100644
index 0000000..fc6a518
--- /dev/null
+++ b/gas/testsuite/gas/i386/property-5.d
@@ -0,0 +1,9 @@
+#name: i386 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: AVX512F
+ x86 feature used: x86, XMM, YMM, ZMM
diff --git a/gas/testsuite/gas/i386/property-5.s b/gas/testsuite/gas/i386/property-5.s
new file mode 100644
index 0000000..ff8ce48
--- /dev/null
+++ b/gas/testsuite/gas/i386/property-5.s
@@ -0,0 +1,2 @@
+ .text
+ {evex} vmovaps %xmm0, %xmm0
diff --git a/gas/testsuite/gas/i386/x86-64-property-4.d b/gas/testsuite/gas/i386/x86-64-property-4.d
new file mode 100644
index 0000000..4a48950
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-property-4.d
@@ -0,0 +1,10 @@
+#name: x86-64 property 4
+#source: property-4.s
+#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: AVX
+ x86 feature used: x86, XMM, YMM
diff --git a/gas/testsuite/gas/i386/x86-64-property-5.d b/gas/testsuite/gas/i386/x86-64-property-5.d
new file mode 100644
index 0000000..590d8d5
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-property-5.d
@@ -0,0 +1,10 @@
+#name: x86-64 property 5
+#source: property-5.s
+#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: AVX512F
+ x86 feature used: x86, XMM, YMM, ZMM