Properly handle EVEX register aliases
authorIlya Tocar <ilya.tocar@intel.com>
Thu, 17 Jul 2014 09:59:32 +0000 (13:59 +0400)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 17 Jul 2014 15:54:05 +0000 (08:54 -0700)
gas/

* config/tc-i386.c (parse_register): Set need_vrex.

gas/testsuite/

* gas/i386/x86-64-equ.d: New.
* gas/i386/x86-64-equ.s: New.
* gas/i386/i386.exp: Run x86-64-equ.

gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/ChangeLog
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/x86-64-equ.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-equ.s [new file with mode: 0644]

index 512bd031f9cc3ad429d247ca56d0cec57a0757a2..9180b52c1551d25ea205545c95d60af5325c1f66 100644 (file)
@@ -1,3 +1,7 @@
+2014-07-17  Ilya Tocar  <ilya.tocar@intel.com>
+
+       * config/tc-i386.c (parse_register): Set need_vrex.
+
 2014-07-15  Jiong Wang  <jiong.wang@arm.com>
 
        * config/tc-arm.c (add_to_lit_pool): Use "inst.operands[1].imm" for
index d0d4d6c9300b3faae46e2782da49ea94b50a5846..c947250fe28d108c4efbdf185fa14c68507ca417 100644 (file)
@@ -9428,6 +9428,8 @@ parse_register (char *reg_string, char **end_op)
          know (e->X_add_number >= 0
                && (valueT) e->X_add_number < i386_regtab_size);
          r = i386_regtab + e->X_add_number;
+         if ((r->reg_flags & RegVRex))
+           i.need_vrex = 1;
          *end_op = input_line_pointer;
        }
       *input_line_pointer = c;
index 4e91b37ef7024833499d0fd5e93538288538811c..a96af2e3170d8add7b915ee23b255451f1ef57f0 100644 (file)
@@ -1,3 +1,9 @@
+2014-07-17  Ilya Tocar  <ilya.tocar@intel.com>
+
+       * gas/i386/x86-64-equ.d: New.
+       * gas/i386/x86-64-equ.s: New.
+       * gas/i386/i386.exp: Run x86-64-equ.
+
 2014-07-12  David Majnemer <david.majnemer@gmail.com>
 
        * gas/pe/set.s, * gas/pe/set.d: New test.
index 6389a07f4e5f69fbcf59cf4610b4f79c454ecfd7..e30e4e6fa23087b0dce0189bc3c0bf5fe7d2d5ba 100644 (file)
@@ -576,6 +576,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
     run_dump_test "x86-64-prefetchwt1"
     run_dump_test "x86-64-prefetchwt1-intel"
     run_dump_test "x86-64-se1"
+    run_dump_test "x86-64-equ"
 
     if { ![istarget "*-*-aix*"]
       && ![istarget "*-*-beos*"]
diff --git a/gas/testsuite/gas/i386/x86-64-equ.d b/gas/testsuite/gas/i386/x86-64-equ.d
new file mode 100644 (file)
index 0000000..3ecb0bb
--- /dev/null
@@ -0,0 +1,11 @@
+#objdump: -drw
+#name: evex equates
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+000 <_start>:
+[      ]*[a-f0-9]+:    62 e1 76 08 58 c8       vaddss %xmm0,%xmm1,%xmm17
+[      ]*[a-f0-9]+:    62 b1 76 08 58 c1       vaddss %xmm17,%xmm1,%xmm0
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-equ.s b/gas/testsuite/gas/i386/x86-64-equ.s
new file mode 100644 (file)
index 0000000..26cfd72
--- /dev/null
@@ -0,0 +1,10 @@
+ .text
+_start:
+
+ .set  ACC, %xmm17
+       vaddss   %xmm0,%xmm1,ACC
+
+ .intel_syntax noprefix
+
+ .set  ACC, xmm17
+       vaddss   xmm0,xmm1,ACC