From 32930e4edbc06bc6f10c435dbcc63131715df678 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 9 Oct 2020 05:05:57 -0700 Subject: x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA levels: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97250 Update GNU_PROPERTY_X86_ISA_1_XXX macros: https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13 in x86 ELF binaries to indicate that micro-architecture ISA levels required to execute the binary: #define GNU_PROPERTY_X86_ISA_1_NEEDED (GNU_PROPERTY_X86_UINT32_OR_LO + 2) #define GNU_PROPERTY_X86_ISA_1_USED (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 2) #define GNU_PROPERTY_X86_ISA_1_V2 (1U << 0) #define GNU_PROPERTY_X86_ISA_1_V3 (1U << 1) #define GNU_PROPERTY_X86_ISA_1_V4 (1U << 2) The previous GNU_PROPERTY_X86_ISA_1_XXX macros are deprecated and renamed to GNU_PROPERTY_X86_COMPAT_2_ISA_1_XXX. In addition to EM_X86_64, GNU_PROPERTY_X86_ISA_1_V[234] marker can be used by ld.so to detect the x86-64-v4 shared library placed in an x86-64-v2 directory by mistake on an x86-64-v2 machine to avoid crashes on x86-64-v4 instructions. Add -z x86-64-v[234] linker command line option to mark x86-64-v[234] ISA level as needed. Also add #define GNU_PROPERTY_X86_FEATURE_2_MASK (1U << 11) for mask registers. bfd/ PR gas/26703 * elf-linker-x86.h (elf_linker_x86_params): Add isa_level. * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge GNU_PROPERTY_X86_ISA_1_V[234]. (_bfd_x86_elf_link_setup_gnu_properties): Generate GNU_PROPERTY_X86_ISA_1_V[234] for -z x86-64-v[234]. binutils/ PR gas/26703 * readelf.c (decode_x86_compat_2_isa): New function. (decode_x86_isa): Updated for new X86_ISA_1_XXX bits. (decode_x86_feature_1): Handle GNU_PROPERTY_X86_FEATURE_2_MASK. (print_gnu_property_note): Handle X86_COMPAT_2_ISA_1_USED, and X86_COMPAT_2_ISA_1_NEEDED. * testsuite/binutils-all/i386/pr21231b.s: Updated to the current GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED values. * testsuite/binutils-all/x86-64/pr21231b.s: Likewise. * testsuite/binutils-all/x86-64/pr23494a.s: Likewise. * testsuite/binutils-all/x86-64/pr23494b.s: Likewise. * testsuite/binutils-all/x86-64/pr23494c.s: Likewise. * testsuite/binutils-all/i386/empty.d: Updated. * testsuite/binutils-all/i386/ibt.d: Likewise. * testsuite/binutils-all/i386/pr21231a.d: Likewise. * testsuite/binutils-all/i386/pr21231b.d: Likewise. * testsuite/binutils-all/i386/shstk.d: Likewise. * testsuite/binutils-all/x86-64/empty-x32.d: Likewise. * testsuite/binutils-all/x86-64/empty.d: Likewise. * testsuite/binutils-all/x86-64/ibt-x32.d: Likewise. * testsuite/binutils-all/x86-64/ibt.d: Likewise. * testsuite/binutils-all/x86-64/pr21231a.d: Likewise. * testsuite/binutils-all/x86-64/pr21231b.d: Likewise. * testsuite/binutils-all/x86-64/pr23494a-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494a.d: Likewise. * testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494c.d: Likewise. * testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494d.d: Likewise. * testsuite/binutils-all/x86-64/pr23494e-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494e.d: Likewise. * testsuite/binutils-all/x86-64/shstk-x32.d: Likewise. * testsuite/binutils-all/x86-64/shstk.d: Likewise. gas/ PR gas/26703 * config/tc-i386.c (xstate): Add xstate_mask. (md_assemble): Check i.types[j], instead of i.tm.operand_types[j], for xstate. Set xstate_mask, instead of xstate_zmm, for RegMask. (output_insn): Update for GNU_PROPERTY_X86_ISA_1_V[234]. Update xstate for mask register and VSIB. * testsuite/gas/i386/i386.exp: Run more GNU_PROPERTY tests. * testsuite/gas/i386/property-1.s: Updated to the current GNU_PROPERTY_X86_ISA_1_USED value. * testsuite/gas/i386/property-2.s: Only keep cmove. * testsuite/gas/i386/property-3.s: Changed to addsubpd. * testsuite/gas/i386/property-1.d: Updated. * testsuite/gas/i386/property-2.d: Likewise. * testsuite/gas/i386/property-3.d: Likewise. * testsuite/gas/i386/property-4.d: Likewise. * testsuite/gas/i386/property-5.d: Likewise. * testsuite/gas/i386/property-6.d: Likewise. * testsuite/gas/i386/x86-64-property-1.d: Likewise. * testsuite/gas/i386/x86-64-property-2.d: Likewise. * testsuite/gas/i386/x86-64-property-3.d: Likewise. * testsuite/gas/i386/x86-64-property-4.d: Likewise. * testsuite/gas/i386/x86-64-property-5.d: Likewise. * testsuite/gas/i386/x86-64-property-6.d: Likewise. * testsuite/gas/i386/x86-64-property-7.d: Likewise. * testsuite/gas/i386/x86-64-property-8.d: Likewise. * testsuite/gas/i386/x86-64-property-9.d: Likewise. * testsuite/gas/i386/property-11.d: New file. * testsuite/gas/i386/property-11.s: Likewise. * testsuite/gas/i386/property-12.d: Likewise. * testsuite/gas/i386/property-12.s: Likewise. * testsuite/gas/i386/property-13.d: Likewise. * testsuite/gas/i386/property-13.s: Likewise. * testsuite/gas/i386/x86-64-property-11.d: Likewise. * testsuite/gas/i386/x86-64-property-12.d: Likewise. * testsuite/gas/i386/x86-64-property-13.d: Likewise. * testsuite/gas/i386/x86-64-property-14.d: Likewise. * testsuite/gas/i386/x86-64-property-14.s: Likewise. include/ PR gas/26703 * elf/common.h (GNU_PROPERTY_X86_ISA_1_USED): Renamed to ... (GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED): This. (GNU_PROPERTY_X86_ISA_1_NEEDED): Renamed to ... (GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED): This. (GNU_PROPERTY_X86_ISA_1_XXX): Renamed to ... (GNU_PROPERTY_X86_COMPAT_2_ISA_1_XXX): This. (GNU_PROPERTY_X86_ISA_1_NEEDED): New. (GNU_PROPERTY_X86_ISA_1_USED): Likewise. (GNU_PROPERTY_X86_ISA_1_V2): Likewise. (GNU_PROPERTY_X86_ISA_1_V3): Likewise. (GNU_PROPERTY_X86_ISA_1_V4): Likewise. (GNU_PROPERTY_X86_FEATURE_2_MASK): Likewise. ld/ PR gas/26703 * NEWS: Mention -z x86-64-v[234]. * ld.texi: Document -z x86-64-v[234]. * emulparams/elf32_x86_64.sh: Use x86-64-level.sh. * emulparams/elf_i386.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/x86-64-level.sh: New file. * testsuite/ld-elf/x86-feature-1a.rd: Update. * testsuite/ld-elf/x86-feature-1b.rd: Likewise. * testsuite/ld-elf/x86-feature-1c.rd: Likewise. * testsuite/ld-elf/x86-feature-1d.rd: Likewise. * testsuite/ld-elf/x86-feature-1e.rd: Likewise. * testsuite/ld-i386/pr23372c.d: Likewise. * testsuite/ld-i386/pr23486c.d: Likewise. * testsuite/ld-i386/pr23486d.d: Likewise. * testsuite/ld-i386/pr24322a.d: Likewise. * testsuite/ld-i386/pr24322b.d: Likewise. * testsuite/ld-i386/property-1a.r: Likewise. * testsuite/ld-i386/property-2a.r: Likewise. * testsuite/ld-i386/property-3.r: Likewise. * testsuite/ld-i386/property-3a.r: Likewise. * testsuite/ld-i386/property-4.r: Likewise. * testsuite/ld-i386/property-4a.r: Likewise. * testsuite/ld-i386/property-5.r: Likewise. * testsuite/ld-i386/property-5a.r: Likewise. * testsuite/ld-i386/property-7a.r: Likewise. * testsuite/ld-i386/property-x86-3.d: Likewise. * testsuite/ld-i386/property-x86-4a.d: Likewise. * testsuite/ld-i386/property-x86-5.d: Likewise. * testsuite/ld-i386/property-x86-cet1.d: Likewise. * testsuite/ld-i386/property-x86-cet2a.d: Likewise. * testsuite/ld-i386/property-x86-cet5a.d: Likewise. * testsuite/ld-i386/property-x86-cet5b.d: Likewise. * testsuite/ld-i386/property-x86-ibt1a.d: Likewise. * testsuite/ld-i386/property-x86-ibt1b.d: Likewise. * testsuite/ld-i386/property-x86-ibt2.d: Likewise. * testsuite/ld-i386/property-x86-ibt3a.d: Likewise. * testsuite/ld-i386/property-x86-ibt3b.d: Likewise. * testsuite/ld-i386/property-x86-ibt4.d: Likewise. * testsuite/ld-i386/property-x86-ibt5.d: Likewise. * testsuite/ld-i386/property-x86-shstk1a.d: Likewise. * testsuite/ld-i386/property-x86-shstk1b.d: Likewise. * testsuite/ld-i386/property-x86-shstk2.d: Likewise. * testsuite/ld-i386/property-x86-shstk3a.d: Likewise. * testsuite/ld-i386/property-x86-shstk3b.d: Likewise. * testsuite/ld-i386/property-x86-shstk4.d: Likewise. * testsuite/ld-i386/property-x86-shstk5.d: Likewise. * testsuite/ld-x86-64/pr23372c-x32.d: Likewise. * testsuite/ld-x86-64/pr23372c.d: Likewise. * testsuite/ld-x86-64/pr23486c.d: Likewise. * testsuite/ld-x86-64/pr23486d-x32.d: Likewise. * testsuite/ld-x86-64/pr23486d.d: Likewise. * testsuite/ld-x86-64/pr24322a-x32.d: Likewise. * testsuite/ld-x86-64/pr24322a.d: Likewise. * testsuite/ld-x86-64/pr24322b-x32.d: Likewise. * testsuite/ld-x86-64/pr24322b.d: Likewise. * testsuite/ld-x86-64/pr24458a-x32.d: Likewise. * testsuite/ld-x86-64/pr24458a.d: Likewise. * testsuite/ld-x86-64/pr24458b-x32.d: Likewise. * testsuite/ld-x86-64/pr24458b.d: Likewise. * testsuite/ld-x86-64/pr24458c-x32.d: Likewise. * testsuite/ld-x86-64/pr24458c.d: Likewise. * testsuite/ld-x86-64/property-1a.r: Likewise. * testsuite/ld-x86-64/property-2a.r: Likewise. * testsuite/ld-x86-64/property-3.r: Likewise. * testsuite/ld-x86-64/property-3a.r: Likewise. * testsuite/ld-x86-64/property-4.r: Likewise. * testsuite/ld-x86-64/property-4a.r: Likewise. * testsuite/ld-x86-64/property-5.r: Likewise. * testsuite/ld-x86-64/property-5a.r: Likewise. * testsuite/ld-x86-64/property-7a.r: Likewise. * testsuite/ld-x86-64/property-x86-3-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-3.d: Likewise. * testsuite/ld-x86-64/property-x86-4a-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-4a.d: Likewise. * testsuite/ld-x86-64/property-x86-5-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-5.d: Likewise. * testsuite/ld-x86-64/property-x86-cet1-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-cet1.d: Likewise. * testsuite/ld-x86-64/property-x86-cet2a-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-cet2a.d: Likewise. * testsuite/ld-x86-64/property-x86-cet5a-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-cet5a.d: Likewise. * testsuite/ld-x86-64/property-x86-cet5b-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-cet5b.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt1a-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt1a.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt1b-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt1b.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt2-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt2.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt3a-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt3a.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt3b-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt3b.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt4-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt4.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt5-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-ibt5.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk1a-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk1a.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk1b-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk1b.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk2-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk2.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk3a-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk3a.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk3b-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk3b.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk4-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk4.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk5-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-shstk5.d: Likewise. * testsuite/ld-i386/i386.exp: Run property-x86-6, property-x86-isa1, property-x86-isa2 and property-x86-isa3. * testsuite/ld-i386/property-x86-1.S: Updated to the current GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED values. * testsuite/ld-i386/property-x86-2.S: Likewise. * testsuite/ld-i386/property-x86-3.s: Likewise. * testsuite/ld-x86-64/pr23372d.s: Likewise. * testsuite/ld-x86-64/pr23372e.s: Likewise. * testsuite/ld-x86-64/pr23372f.s: Likewise. * testsuite/ld-x86-64/pr23486c.s: Likewise. * testsuite/ld-x86-64/pr23486d.s: Likewise. * testsuite/ld-x86-64/property-x86-1.S: Likewise. * testsuite/ld-x86-64/property-x86-2.S: Likewise. * testsuite/ld-x86-64/property-x86-3.s: Likewise. * testsuite/ld-x86-64/property-x86-5a.s: Likewise. * testsuite/ld-x86-64/property-x86-5b.s: Likewise. * testsuite/ld-i386/property-x86-6.d: New file. * testsuite/ld-i386/property-x86-isa1.d: Likewise. * testsuite/ld-i386/property-x86-isa2.d: Likewise. * testsuite/ld-i386/property-x86-isa3.d: Likewise. * testsuite/ld-x86-64/property-x86-6-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-6.d: Likewise. * testsuite/ld-x86-64/property-x86-6.s: Likewise. * testsuite/ld-x86-64/property-x86-isa1-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-isa1.d: Likewise. * testsuite/ld-x86-64/property-x86-isa1.s: Likewise. * testsuite/ld-x86-64/property-x86-isa2-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-isa2.d: Likewise. * testsuite/ld-x86-64/property-x86-isa3-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-isa3.d: Likewise. * testsuite/ld-x86-64/simple.s: Likewise. * ld/testsuite/ld-x86-64/x86-64.exp: Run property-x86-6, property-x86-6-x32, property-x86-isa1, property-x86-isa1-x32, property-x86-isa2, property-x86-isa2-x32, property-x86-isa3-x32 and property-x86-isa3. --- gas/config/tc-i386.c | 126 ++++++++++++++++++++++++++------------------------- 1 file changed, 65 insertions(+), 61 deletions(-) (limited to 'gas/config/tc-i386.c') diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index f3eaba6..64cd78c 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -374,7 +374,9 @@ struct _i386_insn /* Use ZMM state. */ xstate_zmm = 1 << 3 | xstate_ymm, /* Use TMM state. */ - xstate_tmm = 1 << 4 + xstate_tmm = 1 << 4, + /* Use MASK state. */ + xstate_mask = 1 << 5 } xstate; /* Has GOTPC or TLS relocation. */ @@ -4860,7 +4862,7 @@ md_assemble (char *line) for (j = 0; j < i.operands; j++) { i.types[j] = operand_type_and (i.types[j], i.tm.operand_types[j]); - switch (i.tm.operand_types[j].bitfield.class) + switch (i.types[j].bitfield.class) { default: break; @@ -4868,16 +4870,16 @@ md_assemble (char *line) i.xstate |= xstate_mmx; break; case RegMask: - i.xstate |= xstate_zmm; + i.xstate |= xstate_mask; break; case RegSIMD: - if (i.tm.operand_types[j].bitfield.tmmword) + if (i.types[j].bitfield.tmmword) i.xstate |= xstate_tmm; - else if (i.tm.operand_types[j].bitfield.zmmword) + else if (i.types[j].bitfield.zmmword) i.xstate |= xstate_zmm; - else if (i.tm.operand_types[j].bitfield.ymmword) + else if (i.types[j].bitfield.ymmword) i.xstate |= xstate_ymm; - else if (i.tm.operand_types[j].bitfield.xmmword) + else if (i.types[j].bitfield.xmmword) i.xstate |= xstate_xmm; break; } @@ -9167,56 +9169,51 @@ output_insn (void) #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) if (IS_ELF && x86_used_note && now_seg != absolute_section) { - if (i.tm.cpu_flags.bitfield.cpucmov) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_CMOV; - if (i.tm.cpu_flags.bitfield.cpusse) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE; - if (i.tm.cpu_flags.bitfield.cpusse2) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE2; - if (i.tm.cpu_flags.bitfield.cpusse3) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE3; - if (i.tm.cpu_flags.bitfield.cpussse3) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSSE3; - if (i.tm.cpu_flags.bitfield.cpusse4_1) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE4_1; - if (i.tm.cpu_flags.bitfield.cpusse4_2) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_SSE4_2; - if (i.tm.cpu_flags.bitfield.cpuavx) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX; - if (i.tm.cpu_flags.bitfield.cpuavx2) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX2; - if (i.tm.cpu_flags.bitfield.cpufma) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_FMA; - if (i.tm.cpu_flags.bitfield.cpuavx512f) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512F; - if (i.tm.cpu_flags.bitfield.cpuavx512cd) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512CD; - if (i.tm.cpu_flags.bitfield.cpuavx512er) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512ER; - if (i.tm.cpu_flags.bitfield.cpuavx512pf) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512PF; - if (i.tm.cpu_flags.bitfield.cpuavx512vl) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512VL; - if (i.tm.cpu_flags.bitfield.cpuavx512dq) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512DQ; - if (i.tm.cpu_flags.bitfield.cpuavx512bw) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512BW; - if (i.tm.cpu_flags.bitfield.cpuavx512_4fmaps) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_4FMAPS; - if (i.tm.cpu_flags.bitfield.cpuavx512_4vnniw) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_4VNNIW; - if (i.tm.cpu_flags.bitfield.cpuavx512_bitalg) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_BITALG; - if (i.tm.cpu_flags.bitfield.cpuavx512ifma) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_IFMA; - if (i.tm.cpu_flags.bitfield.cpuavx512vbmi) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_VBMI; - if (i.tm.cpu_flags.bitfield.cpuavx512_vbmi2) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_VBMI2; - if (i.tm.cpu_flags.bitfield.cpuavx512_vnni) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_VNNI; - if (i.tm.cpu_flags.bitfield.cpuavx512_bf16) - x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_BF16; + if ((i.xstate & xstate_tmm) == xstate_tmm + || i.tm.cpu_flags.bitfield.cpuamx_tile) + x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_TMM; + + if (i.tm.cpu_flags.bitfield.cpusse3 + || i.tm.cpu_flags.bitfield.cpussse3 + || i.tm.cpu_flags.bitfield.cpusse4_1 + || i.tm.cpu_flags.bitfield.cpusse4_2 + || i.tm.cpu_flags.bitfield.cpucx16 + || i.tm.cpu_flags.bitfield.cpupopcnt + /* LAHF-SAHF insns in 64-bit mode. */ + || (flag_code == CODE_64BIT + && (i.tm.base_opcode | 1) == 0x9f)) + x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_V2; + if (i.tm.cpu_flags.bitfield.cpuavx + || i.tm.cpu_flags.bitfield.cpuavx2 + /* Any VEX encoded insns execpt for CpuAVX512F, CpuAVX512BW, + CpuAVX512DQ, LPW, TBM and AMX. */ + || (i.tm.opcode_modifier.vex + && !i.tm.cpu_flags.bitfield.cpuavx512f + && !i.tm.cpu_flags.bitfield.cpuavx512bw + && !i.tm.cpu_flags.bitfield.cpuavx512dq + && !i.tm.cpu_flags.bitfield.cpulwp + && !i.tm.cpu_flags.bitfield.cputbm + && !(x86_feature_2_used & GNU_PROPERTY_X86_FEATURE_2_TMM)) + || i.tm.cpu_flags.bitfield.cpuf16c + || i.tm.cpu_flags.bitfield.cpufma + || i.tm.cpu_flags.bitfield.cpulzcnt + || i.tm.cpu_flags.bitfield.cpumovbe + || i.tm.cpu_flags.bitfield.cpuxsave + || i.tm.cpu_flags.bitfield.cpuxsavec + || i.tm.cpu_flags.bitfield.cpuxsaveopt + || i.tm.cpu_flags.bitfield.cpuxsaves) + x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_V3; + if (i.tm.cpu_flags.bitfield.cpuavx512f + || i.tm.cpu_flags.bitfield.cpuavx512bw + || i.tm.cpu_flags.bitfield.cpuavx512dq + || i.tm.cpu_flags.bitfield.cpuavx512vl + /* Any EVEX encoded insns except for AVX512ER, AVX512PF and + VNNIW. */ + || (i.tm.opcode_modifier.evex + && !i.tm.cpu_flags.bitfield.cpuavx512er + && !i.tm.cpu_flags.bitfield.cpuavx512pf + && !i.tm.cpu_flags.bitfield.cpuavx512_4vnniw)) + x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_V4; if (i.tm.cpu_flags.bitfield.cpu8087 || i.tm.cpu_flags.bitfield.cpu287 @@ -9228,6 +9225,15 @@ output_insn (void) || i.tm.base_opcode == 0xf77 /* emms */ || i.tm.base_opcode == 0xf0e /* femms */) x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_MMX; + if (i.index_reg) + { + if (i.index_reg->reg_type.bitfield.zmmword) + i.xstate |= xstate_zmm; + else if (i.index_reg->reg_type.bitfield.ymmword) + i.xstate |= xstate_ymm; + else if (i.index_reg->reg_type.bitfield.xmmword) + i.xstate |= xstate_xmm; + } if ((i.xstate & xstate_xmm) || i.tm.cpu_flags.bitfield.cpuwidekl || i.tm.cpu_flags.bitfield.cpukl) @@ -9236,6 +9242,8 @@ output_insn (void) x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_YMM; if ((i.xstate & xstate_zmm) == xstate_zmm) x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_ZMM; + if (i.mask || (i.xstate & xstate_mask) == xstate_mask) + x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_MASK; if (i.tm.cpu_flags.bitfield.cpufxsr) x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_FXSR; if (i.tm.cpu_flags.bitfield.cpuxsave) @@ -9244,10 +9252,6 @@ 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 -- cgit v1.1