This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH,i386] Correctly handle .set derective for evex registers.


On Thu, Jul 17, 2014 at 5:43 AM, Ilya Tocar <tocarip.intel@gmail.com> wrote:
> Hi,
>
> Currently we fail on following code:
>
>     .set  ACC, %xmm17
>     vaddss   %xmm0,%xmm1,ACC
>
> Attached patch fixes it.
> Ok for trunk?
>

I checked it into master and 2.24 branch with some modifications.

Thanks.

-- 
H.J.
-----
commit d3bb6b49b6f13617b953bfa0ef25a992b41128ef
Author: Ilya Tocar <ilya.tocar@intel.com>
Date:   Thu Jul 17 13:59:32 2014 +0400

    Properly handle EVEX register aliases

    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.

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 512bd03..9180b52 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index d0d4d6c..c947250 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -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;
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 4e91b37..a96af2e 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -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.
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 6389a07..e30e4e6 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -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
index 0000000..3ecb0bb
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-equ.d
@@ -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
index 0000000..26cfd72
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-equ.s
@@ -0,0 +1,10 @@
+ .text
+_start:
+
+ .set ACC, %xmm17
+ vaddss   %xmm0,%xmm1,ACC
+
+ .intel_syntax noprefix
+
+ .set ACC, xmm17
+ vaddss   xmm0,xmm1,ACC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]