[llvm-commits] [llvm] r122667 - in /llvm/trunk: lib/Target/X86/X86AsmPrinter.cpp test/CodeGen/X86/inline-asm-h.ll

Rafael Espindola rafael.espindola at gmail.com
Sat Jan 1 12:58:46 PST 2011


Author: rafael
Date: Sat Jan  1 14:58:46 2011
New Revision: 122667

URL: http://llvm.org/viewvc/llvm-project?rev=122667&view=rev
Log:
Add support for the 'H' modifier.

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

Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp?rev=122667&r1=122666&r2=122667&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Sat Jan  1 14:58:46 2011
@@ -302,6 +302,9 @@
     printSymbolOperand(MI->getOperand(Op+3), O);
   }
 
+  if (Modifier && strcmp(Modifier, "H") == 0)
+    O << "+8";
+
   if (HasParenPart) {
     assert(IndexReg.getReg() != X86::ESP &&
            "X86 doesn't allow scaling by ESP");
@@ -458,6 +461,9 @@
     case 'q': // Print SImode register
       // These only apply to registers, ignore on mem.
       break;
+    case 'H':
+      printMemReference(MI, OpNo, O, "H");
+      return false;
     case 'P': // Don't print @PLT, but do print as memory.
       printMemReference(MI, OpNo, O, "no-rip");
       return false;

Added: llvm/trunk/test/CodeGen/X86/inline-asm-h.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/inline-asm-h.ll?rev=122667&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/inline-asm-h.ll (added)
+++ llvm/trunk/test/CodeGen/X86/inline-asm-h.ll Sat Jan  1 14:58:46 2011
@@ -0,0 +1,12 @@
+; RUN: llc -march=x86-64 < %s | FileCheck %s
+
+ at foobar = common global i32 0, align 4
+
+define void @zed() nounwind {
+entry:
+  call void asm "movq %mm2,${0:H}", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* @foobar) nounwind
+  ret void
+}
+
+; CHECK: zed
+; CHECK: movq %mm2,foobar+8(%rip)





More information about the llvm-commits mailing list