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.
This commit is contained in:
H.J. Lu 2020-07-09 10:33:25 -07:00
parent fc238d4a06
commit 39776b1117
9 changed files with 64 additions and 2 deletions

View File

@ -1,3 +1,14 @@
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.

View File

@ -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;

View File

@ -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"

View File

@ -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

View File

@ -0,0 +1,2 @@
.text
{vex} vmovaps %xmm0, %xmm0

View File

@ -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

View File

@ -0,0 +1,2 @@
.text
{evex} vmovaps %xmm0, %xmm0

View File

@ -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

View File

@ -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