[llvm] r325192 - [X86] Dont' allow 'outs' and 'ins' in at&t syntax without suffixes.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 15:53:26 PST 2018
Author: ctopper
Date: Wed Feb 14 15:53:26 2018
New Revision: 325192
URL: http://llvm.org/viewvc/llvm-project?rev=325192&view=rev
Log:
[X86] Dont' allow 'outs' and 'ins' in at&t syntax without suffixes.
The match would be ambiguous, but at&t asm parsing doesn't support ambiguous matches and will just return the first.
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.td
llvm/trunk/test/MC/X86/x86-32.s
llvm/trunk/test/MC/X86/x86-64.s
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=325192&r1=325191&r2=325192&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Feb 14 15:53:26 2018
@@ -3172,15 +3172,15 @@ def : InstAlias<"imul{q}\t{$imm, $r|$r,
// ins aliases. Accept the mnemonic suffix being omitted because it's implicit
// in the destination.
-def : InstAlias<"ins\t{%dx, $dst|$dst, dx}", (INSB dstidx8:$dst), 0>;
-def : InstAlias<"ins\t{%dx, $dst|$dst, dx}", (INSW dstidx16:$dst), 0>;
-def : InstAlias<"ins\t{%dx, $dst|$dst, dx}", (INSL dstidx32:$dst), 0>;
+def : InstAlias<"ins{b}\t{%dx, $dst|$dst, dx}", (INSB dstidx8:$dst), 0>;
+def : InstAlias<"ins{w}\t{%dx, $dst|$dst, dx}", (INSW dstidx16:$dst), 0>;
+def : InstAlias<"ins{l}\t{%dx, $dst|$dst, dx}", (INSL dstidx32:$dst), 0>;
// outs aliases. Accept the mnemonic suffix being omitted because it's implicit
// in the source.
-def : InstAlias<"outs\t{$src, %dx|dx, $src}", (OUTSB srcidx8:$src), 0>;
-def : InstAlias<"outs\t{$src, %dx|dx, $src}", (OUTSW srcidx16:$src), 0>;
-def : InstAlias<"outs\t{$src, %dx|dx, $src}", (OUTSL srcidx32:$src), 0>;
+def : InstAlias<"outs{b}\t{$src, %dx|dx, $src}", (OUTSB srcidx8:$src), 0>;
+def : InstAlias<"outs{w}\t{$src, %dx|dx, $src}", (OUTSW srcidx16:$src), 0>;
+def : InstAlias<"outs{l}\t{$src, %dx|dx, $src}", (OUTSL srcidx32:$src), 0>;
// inb %dx -> inb %al, %dx
def : InstAlias<"inb\t{%dx|dx}", (IN8rr), 0>;
Modified: llvm/trunk/test/MC/X86/x86-32.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-32.s?rev=325192&r1=325191&r2=325192&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-32.s (original)
+++ llvm/trunk/test/MC/X86/x86-32.s Wed Feb 14 15:53:26 2018
@@ -644,8 +644,6 @@ inl (%dx), %eax
//PR15455
-outs (%esi), (%dx)
-// CHECK: outsw (%esi), %dx
outsb (%esi), (%dx)
// CHECK: outsb (%esi), %dx
outsw (%esi), (%dx)
@@ -653,8 +651,6 @@ outsw (%esi), (%dx)
outsl (%esi), (%dx)
// CHECK: outsl (%esi), %dx
-ins (%dx), %es:(%edi)
-// CHECK: insw %dx, %es:(%edi)
insb (%dx), %es:(%edi)
// CHECK: insb %dx, %es:(%edi)
insw (%dx), %es:(%edi)
Modified: llvm/trunk/test/MC/X86/x86-64.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-64.s?rev=325192&r1=325191&r2=325192&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-64.s (original)
+++ llvm/trunk/test/MC/X86/x86-64.s Wed Feb 14 15:53:26 2018
@@ -288,9 +288,6 @@ inl (%dx), %eax
//PR15455
-// permitted invalid memory forms
-outs (%rsi), (%dx)
-// CHECK: outsw (%rsi), %dx
outsb (%rsi), (%dx)
// CHECK: outsb (%rsi), %dx
outsw (%rsi), (%dx)
@@ -298,8 +295,6 @@ outsw (%rsi), (%dx)
outsl (%rsi), (%dx)
// CHECK: outsl (%rsi), %dx
-ins (%dx), %es:(%rdi)
-// CHECK: insw %dx, %es:(%rdi)
insb (%dx), %es:(%rdi)
// CHECK: insb %dx, %es:(%rdi)
insw (%dx), %es:(%rdi)
More information about the llvm-commits
mailing list