diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-02-15 07:29:18 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-02-15 07:29:18 +0000 |
commit | 0877c6575addcce0807cf2181f92f83a19e30954 (patch) | |
tree | 077f34ea57ee326d6110417cf05118e1a5670f48 | |
parent | b556a706f617beff8cf6947e6d1f0cc97391631b (diff) | |
download | llvm-0877c6575addcce0807cf2181f92f83a19e30954.tar.gz |
Add opcode extension forms of MOV8ri/MOV16ri/MOV32ri.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201463 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86InstrInfo.td | 10 | ||||
-rw-r--r-- | test/MC/Disassembler/X86/x86-32.txt | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index ac7ff500d3c5..34a592ffbbb5 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -1212,6 +1212,16 @@ def MOV64ri : RIi64<0xB8, AddRegFrm, (outs GR64:$dst), (ins i64imm:$src), "movabs{q}\t{$src, $dst|$dst, $src}", [(set GR64:$dst, imm:$src)], IIC_MOV>; } + +// Longer forms that use a ModR/M byte. Needed for disassembler +let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in { +def MOV8ri_alt : Ii8 <0xC6, MRM0r, (outs GR8 :$dst), (ins i8imm :$src), + "mov{b}\t{$src, $dst|$dst, $src}", [], IIC_MOV>; +def MOV16ri_alt : Ii16<0xC7, MRM0r, (outs GR16:$dst), (ins i16imm:$src), + "mov{w}\t{$src, $dst|$dst, $src}", [], IIC_MOV>, OpSize16; +def MOV32ri_alt : Ii32<0xC7, MRM0r, (outs GR32:$dst), (ins i32imm:$src), + "mov{l}\t{$src, $dst|$dst, $src}", [], IIC_MOV>, OpSize32; +} } // SchedRW let SchedRW = [WriteStore] in { diff --git a/test/MC/Disassembler/X86/x86-32.txt b/test/MC/Disassembler/X86/x86-32.txt index e906c1ae7939..a4a0b2cf9f07 100644 --- a/test/MC/Disassembler/X86/x86-32.txt +++ b/test/MC/Disassembler/X86/x86-32.txt @@ -699,3 +699,12 @@ # CHECK: movl %fs:0, %eax 0x64 0xa1 0x00 0x00 0x00 0x00 + +# CHECK: movb $-1, %al +0xc6 0xc0 0xff + +# CHECK: movw $65535, %ax +0x66 0xc7 0xc0 0xff 0xff + +# CHECK: movl $4294967295, %eax +0xc7 0xc0 0xff 0xff 0xff 0xff |