]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
i386: Clear vex instead of vex.evex
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 4 Apr 2018 11:36:44 +0000 (04:36 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 4 Apr 2018 13:22:11 +0000 (06:22 -0700)
"vex" has many fields to control how to decode an instruction.  Clear
all fields in "vex" before decoding an instruction to avoid using values
left from the previous instruction.

gas/

PR binutils/23025
* testsuite/gas/i386/prefix.s: Add tests for vcvtpd2dq with
VEX and EVEX prefixes.
* testsuite/gas/i386/prefix.d: Updated.

opcodes/

PR binutils/23025
* i386-dis.c (get_valid_dis386): Don't set vex.prefix nor vex.w
to 0.
(print_insn): Clear vex instead of vex.evex.

(cherry picked from commit caf0678c84b5b55fbc4bcc853954745a4ad8b658)

gas/ChangeLog
gas/testsuite/gas/i386/prefix.d
gas/testsuite/gas/i386/prefix.s
opcodes/ChangeLog
opcodes/i386-dis.c

index 30bc4fd3c7cbc436de7423e0b039c7c5bb5a1afd..7da124a254d966cbe6e7cc3e8b0065be35cddaa3 100644 (file)
@@ -1,3 +1,13 @@
+2018-04-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from master branch
+       2018-04-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/23025
+       * testsuite/gas/i386/prefix.s: Add tests for vcvtpd2dq with
+       VEX and EVEX prefixes.
+       * testsuite/gas/i386/prefix.d: Updated.
+
 2018-03-29  Nick Clifton  <nickc@redhat.com>
 
        Import from mainline:
index 8dd200be087ae5dece3fc59b71dd5a385832f2d9..e9ad5eb56c014ecabf89d6a7b5ffe4572f4ad4ff 100644 (file)
@@ -72,5 +72,8 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    90                      nop
 [      ]*[a-f0-9]+:    f2 0f c7                \(bad\)  
 [      ]*[a-f0-9]+:    f0 90                   lock nop
+[      ]*[a-f0-9]+:    c5 fb e6 40 20          vcvtpd2dqx 0x20\(%eax\),%xmm0
+[      ]*[a-f0-9]+:    62 f1 ff 18 e6 40 04    vcvtpd2dq 0x20\(%eax\)\{1to2\},%xmm0
+[      ]*[a-f0-9]+:    c5 fb e6 40 20          vcvtpd2dqx 0x20\(%eax\),%xmm0
        ...
 #pass
index 12d8bbc007d570d024fc49b41f2aac386d3db5b9..a4c60a71448494253a83ef9060c5919b6ace5aab 100644 (file)
 
        nop
 
+       vcvtpd2dqx 0x20(%eax),%xmm0
+       vcvtpd2dq 0x20(%eax){1to2},%xmm0
+       vcvtpd2dqx 0x20(%eax),%xmm0
+
 # Get a good alignment.
  .p2align      4,0
index cae90ebe124ea571cce42af47cb898df87d3441e..daa18f67f844f09cfb4dd5a9484af252c982ffdf 100644 (file)
@@ -1,3 +1,13 @@
+2018-04-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from master branch
+       2018-04-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/23025
+       * i386-dis.c (get_valid_dis386): Don't set vex.prefix nor vex.w
+       to 0.
+       (print_insn): Clear vex instead of vex.evex.
+
 2018-03-16  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        Backport from mainline
index 86a2cdd02295cfd65d97cf360e9c549cea7080da..a9874dec968287dd27209d2360c31d308ff2f6df 100644 (file)
@@ -12815,7 +12815,6 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       switch ((*codep & 0x3))
        {
        case 0:
-         vex.prefix = 0;
          break;
        case 1:
          vex.prefix = DATA_PREFIX_OPCODE;
@@ -12880,7 +12879,6 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       switch ((*codep & 0x3))
        {
        case 0:
-         vex.prefix = 0;
          break;
        case 1:
          vex.prefix = DATA_PREFIX_OPCODE;
@@ -12918,12 +12916,10 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
         VEX.vvvv is 1.  */
       vex.register_specifier = (~(*codep >> 3)) & 0xf;
-      vex.w = 0;
       vex.length = (*codep & 0x4) ? 256 : 128;
       switch ((*codep & 0x3))
        {
        case 0:
-         vex.prefix = 0;
          break;
        case 1:
          vex.prefix = DATA_PREFIX_OPCODE;
@@ -12998,7 +12994,6 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       switch ((*codep & 0x3))
        {
        case 0:
-         vex.prefix = 0;
          break;
        case 1:
          vex.prefix = DATA_PREFIX_OPCODE;
@@ -13356,7 +13351,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
   need_vex = 0;
   need_vex_reg = 0;
   vex_w_done = 0;
-  vex.evex = 0;
+  memset (&vex, 0, sizeof (vex));
 
   if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
     {