From d3bb6b49b6f13617b953bfa0ef25a992b41128ef Mon Sep 17 00:00:00 2001 From: Ilya Tocar Date: Thu, 17 Jul 2014 13:59:32 +0400 Subject: [PATCH] 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. --- gas/ChangeLog | 4 ++++ gas/config/tc-i386.c | 2 ++ gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/i386/i386.exp | 1 + gas/testsuite/gas/i386/x86-64-equ.d | 11 +++++++++++ gas/testsuite/gas/i386/x86-64-equ.s | 10 ++++++++++ 6 files changed, 34 insertions(+) create mode 100644 gas/testsuite/gas/i386/x86-64-equ.d create mode 100644 gas/testsuite/gas/i386/x86-64-equ.s 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 + + * config/tc-i386.c (parse_register): Set need_vrex. + 2014-07-15 Jiong Wang * 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 + + * 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 * 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 -- 2.7.4