llvm.org GIT mirror llvm / 364091e
Support x86 specific inline asm modifier 'J'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56483 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 11 years ago
2 changed file(s) with 16 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
70797079 }
70807080 }
70817081 return;
7082 case 'J':
7083 if (ConstantSDNode *C = dyn_cast(Op)) {
7084 if (C->getZExtValue() <= 63) {
7085 Result = DAG.getTargetConstant(C->getZExtValue(), Op.getValueType());
7086 break;
7087 }
7088 }
7089 return;
70827090 case 'N':
70837091 if (ConstantSDNode *C = dyn_cast(Op)) {
70847092 if (C->getZExtValue() <= 255) {
0 ; RUN: llvm-as < %s | llc -march=x86
11
2 define i32 @test1() {
2 define i32 @test1() nounwind {
33 ; Dest is AX, dest type = i32.
44 %tmp4 = call i32 asm sideeffect "FROB $0", "={ax}"()
55 ret i32 %tmp4
66 }
77
8 define void @test2(i32 %V) {
8 define void @test2(i32 %V) nounwind {
99 ; input is AX, in type = i32.
1010 call void asm sideeffect "FROB $0", "{ax}"(i32 %V)
1111 ret void
1212 }
1313
14 define void @test3() {
14 define void @test3() nounwind {
1515 ; FP constant as a memory operand.
1616 tail call void asm sideeffect "frob $0", "m"( float 0x41E0000000000000)
1717 ret void
1818 }
1919
20
20 define void @test4() nounwind {
21 ; J means a constant in range 0 to 63.
22 tail call void asm sideeffect "bork $0", "J"(i32 37) nounwind
23 ret void
24 }