+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.
 
        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;
 
        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"
        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"
 
--- /dev/null
+#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
 
--- /dev/null
+       .text
+       {vex} vmovaps %xmm0, %xmm0
 
--- /dev/null
+#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
 
--- /dev/null
+       .text
+       {evex} vmovaps %xmm0, %xmm0
 
--- /dev/null
+#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
 
--- /dev/null
+#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