[llvm-commits] [llvm] r154468 - in /llvm/trunk: lib/Target/X86/X86InstrControl.td test/MC/Disassembler/X86/intel-syntax.txt test/MC/X86/intel-syntax-encoding.s test/MC/X86/x86-32.s test/MC/X86/x86-64.s
Charles Davis
cdavis at mines.edu
Tue Apr 10 18:10:53 PDT 2012
Author: cdavis
Date: Tue Apr 10 20:10:53 2012
New Revision: 154468
URL: http://llvm.org/viewvc/llvm-project?rev=154468&view=rev
Log:
Add retw and lretw instructions. Also, fix Intel syntax parsing for all
ret instructions.
Modified:
llvm/trunk/lib/Target/X86/X86InstrControl.td
llvm/trunk/test/MC/Disassembler/X86/intel-syntax.txt
llvm/trunk/test/MC/X86/intel-syntax-encoding.s
llvm/trunk/test/MC/X86/x86-32.s
llvm/trunk/test/MC/X86/x86-64.s
Modified: llvm/trunk/lib/Target/X86/X86InstrControl.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrControl.td?rev=154468&r1=154467&r2=154468&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrControl.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrControl.td Tue Apr 10 20:10:53 2012
@@ -21,20 +21,25 @@
def RET : I <0xC3, RawFrm, (outs), (ins variable_ops),
"ret",
[(X86retflag 0)], IIC_RET>;
+ def RETW : I <0xC3, RawFrm, (outs), (ins variable_ops),
+ "ret{w}",
+ [], IIC_RET>, OpSize;
def RETI : Ii16<0xC2, RawFrm, (outs), (ins i16imm:$amt, variable_ops),
"ret\t$amt",
[(X86retflag timm:$amt)], IIC_RET_IMM>;
def RETIW : Ii16<0xC2, RawFrm, (outs), (ins i16imm:$amt, variable_ops),
- "retw\t$amt",
+ "ret{w}\t$amt",
[], IIC_RET_IMM>, OpSize;
def LRETL : I <0xCB, RawFrm, (outs), (ins),
- "lretl", [], IIC_RET>;
+ "{l}ret{l|f}", [], IIC_RET>;
+ def LRETW : I <0xCB, RawFrm, (outs), (ins),
+ "{l}ret{w|f}", [], IIC_RET>, OpSize;
def LRETQ : RI <0xCB, RawFrm, (outs), (ins),
- "lretq", [], IIC_RET>;
+ "{l}ret{q|f}", [], IIC_RET>;
def LRETI : Ii16<0xCA, RawFrm, (outs), (ins i16imm:$amt),
- "lret\t$amt", [], IIC_RET>;
+ "{l}ret{l|f}\t$amt", [], IIC_RET>;
def LRETIW : Ii16<0xCA, RawFrm, (outs), (ins i16imm:$amt),
- "lretw\t$amt", [], IIC_RET>, OpSize;
+ "{l}ret{w|f}\t$amt", [], IIC_RET>, OpSize;
}
// Unconditional branches.
Modified: llvm/trunk/test/MC/Disassembler/X86/intel-syntax.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/X86/intel-syntax.txt?rev=154468&r1=154467&r2=154468&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/X86/intel-syntax.txt (original)
+++ llvm/trunk/test/MC/Disassembler/X86/intel-syntax.txt Tue Apr 10 20:10:53 2012
@@ -99,3 +99,9 @@
# CHECK: iretq
0x48 0xcf
+# CHECK: ret
+0x66 0xc3
+
+# CHECK: retf
+0x66 0xcb
+
Modified: llvm/trunk/test/MC/X86/intel-syntax-encoding.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/intel-syntax-encoding.s?rev=154468&r1=154467&r2=154468&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/intel-syntax-encoding.s (original)
+++ llvm/trunk/test/MC/X86/intel-syntax-encoding.s Tue Apr 10 20:10:53 2012
@@ -42,3 +42,16 @@
// CHECK: encoding: [0x0f,0xc2,0xd1,0x01]
cmpltps XMM2, XMM1
+
+// CHECK: encoding: [0xc3]
+ ret
+
+// CHECK: encoding: [0xcb]
+ retf
+
+// CHECK: encoding: [0xc2,0x08,0x00]
+ ret 8
+
+// CHECK: encoding: [0xca,0x08,0x00]
+ retf 8
+
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=154468&r1=154467&r2=154468&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-32.s (original)
+++ llvm/trunk/test/MC/X86/x86-32.s Tue Apr 10 20:10:53 2012
@@ -990,3 +990,11 @@
// CHECK: xchgl %ecx, %eax
// CHECK: encoding: [0x91]
xchgl %eax, %ecx
+
+// CHECK: retw
+// CHECK: encoding: [0x66,0xc3]
+retw
+
+// CHECK: lretw
+// CHECK: encoding: [0x66,0xcb]
+lretw
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=154468&r1=154467&r2=154468&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-64.s (original)
+++ llvm/trunk/test/MC/X86/x86-64.s Tue Apr 10 20:10:53 2012
@@ -50,6 +50,9 @@
// CHECK: ret
ret
+// CHECK: retw
+ retw
+
// FIXME: Check that this matches SUB32ri8
// CHECK: subl $1, %eax
subl $1, %eax
@@ -841,6 +844,7 @@
lretq // CHECK: lretq # encoding: [0x48,0xcb]
lretl // CHECK: lretl # encoding: [0xcb]
lret // CHECK: lretl # encoding: [0xcb]
+lretw // CHECK: lretw # encoding: [0x66,0xcb]
// rdar://8403907
sysret
More information about the llvm-commits
mailing list