aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-05-12 22:48:24 +0000
committerChris Lattner <sabre@nondot.org>2010-05-12 22:48:24 +0000
commit2745f6e920dd8b562ded008e3e34acc873c5a36f (patch)
tree95775ab5e430eccc09d2264caa1993d62d987b35
parent9a1581b9102511282ee823ab9a29819bc060e6a5 (diff)
downloadexternal_llvm-2745f6e920dd8b562ded008e3e34acc873c5a36f.zip
external_llvm-2745f6e920dd8b562ded008e3e34acc873c5a36f.tar.gz
external_llvm-2745f6e920dd8b562ded008e3e34acc873c5a36f.tar.bz2
fix the encoding of the obscure "moffset" forms of moves, i386
part first. rdar://7947184 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103660 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86InstrInfo.td11
-rw-r--r--test/MC/AsmParser/X86/x86_32-new-encoder.s7
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index 4bb8cd2..fc33ba9 100644
--- a/lib/Target/X86/X86InstrInfo.td
+++ b/lib/Target/X86/X86InstrInfo.td
@@ -966,16 +966,17 @@ def MOV32mi : Ii32<0xC7, MRM0m, (outs), (ins i32mem:$dst, i32imm:$src),
"mov{l}\t{$src, $dst|$dst, $src}",
[(store (i32 imm:$src), addr:$dst)]>;
-def MOV8o8a : Ii8 <0xA0, RawFrm, (outs), (ins offset8:$src),
+/// moffs8, moffs16, moffs32 and moffs64 versions of moves. The immediate is a
+/// 32-bit offset from the PC.
+def MOV8o8a : Ii32 <0xA0, RawFrm, (outs), (ins offset8:$src),
"mov{b}\t{$src, %al|%al, $src}", []>;
-def MOV16o16a : Ii16 <0xA1, RawFrm, (outs), (ins offset16:$src),
+def MOV16o16a : Ii32 <0xA1, RawFrm, (outs), (ins offset16:$src),
"mov{w}\t{$src, %ax|%ax, $src}", []>, OpSize;
def MOV32o32a : Ii32 <0xA1, RawFrm, (outs), (ins offset32:$src),
"mov{l}\t{$src, %eax|%eax, $src}", []>;
-
-def MOV8ao8 : Ii8 <0xA2, RawFrm, (outs offset8:$dst), (ins),
+def MOV8ao8 : Ii32 <0xA2, RawFrm, (outs offset8:$dst), (ins),
"mov{b}\t{%al, $dst|$dst, %al}", []>;
-def MOV16ao16 : Ii16 <0xA3, RawFrm, (outs offset16:$dst), (ins),
+def MOV16ao16 : Ii32 <0xA3, RawFrm, (outs offset16:$dst), (ins),
"mov{w}\t{%ax, $dst|$dst, %ax}", []>, OpSize;
def MOV32ao32 : Ii32 <0xA3, RawFrm, (outs offset32:$dst), (ins),
"mov{l}\t{%eax, $dst|$dst, %eax}", []>;
diff --git a/test/MC/AsmParser/X86/x86_32-new-encoder.s b/test/MC/AsmParser/X86/x86_32-new-encoder.s
index c00007f..6ce9868 100644
--- a/test/MC/AsmParser/X86/x86_32-new-encoder.s
+++ b/test/MC/AsmParser/X86/x86_32-new-encoder.s
@@ -50,3 +50,10 @@ rdtscp
// CHECK: shrl %eax # encoding: [0xd1,0xe8]
shrl $1, %eax
+
+// moffset forms of moves, rdar://7947184
+
+movb 0, %al // CHECK: movb 0, %al # encoding: [0xa0,A,A,A,A]
+movw 0, %ax // CHECK: movw 0, %ax # encoding: [0x66,0xa1,A,A,A,A]
+movl 0, %eax // CHECK: movl 0, %eax # encoding: [0xa1,A,A,A,A]
+