[llvm-commits] [llvm] r56483 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/inline-asm.ll

Evan Cheng evan.cheng at apple.com
Mon Sep 22 16:57:38 PDT 2008


Author: evancheng
Date: Mon Sep 22 18:57:37 2008
New Revision: 56483

URL: http://llvm.org/viewvc/llvm-project?rev=56483&view=rev
Log:
Support x86 specific inline asm modifier 'J'.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/test/CodeGen/X86/inline-asm.ll

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=56483&r1=56482&r2=56483&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 22 18:57:37 2008
@@ -7080,6 +7080,14 @@
       }
     }
     return;
+  case 'J':
+    if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
+      if (C->getZExtValue() <= 63) {
+        Result = DAG.getTargetConstant(C->getZExtValue(), Op.getValueType());
+        break;
+      }
+    }
+    return;
   case 'N':
     if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
       if (C->getZExtValue() <= 255) {

Modified: llvm/trunk/test/CodeGen/X86/inline-asm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/inline-asm.ll?rev=56483&r1=56482&r2=56483&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/X86/inline-asm.ll (original)
+++ llvm/trunk/test/CodeGen/X86/inline-asm.ll Mon Sep 22 18:57:37 2008
@@ -1,21 +1,25 @@
 ; RUN: llvm-as < %s | llc -march=x86
 
-define i32 @test1() {
+define i32 @test1() nounwind {
 	; Dest is AX, dest type = i32.
         %tmp4 = call i32 asm sideeffect "FROB $0", "={ax}"()
         ret i32 %tmp4
 }
 
-define void @test2(i32 %V) {
+define void @test2(i32 %V) nounwind {
 	; input is AX, in type = i32.
         call void asm sideeffect "FROB $0", "{ax}"(i32 %V)
         ret void
 }
 
-define void @test3() {
+define void @test3() nounwind {
         ; FP constant as a memory operand.
         tail call void asm sideeffect "frob $0", "m"( float 0x41E0000000000000)
         ret void
 }
 
-
+define void @test4() nounwind {
+       ; J means a constant in range 0 to 63.
+       tail call void asm sideeffect "bork $0", "J"(i32 37) nounwind
+       ret void
+}





More information about the llvm-commits mailing list