[llvm-commits] [llvm] r79961 - in /llvm/trunk: lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp test/CodeGen/X86/asm-modifier.ll
Dale Johannesen
dalej at apple.com
Mon Aug 24 17:16:14 PDT 2009
Author: johannes
Date: Mon Aug 24 19:16:14 2009
New Revision: 79961
URL: http://llvm.org/viewvc/llvm-project?rev=79961&view=rev
Log:
Fix PR 4751, another difficulty with %a modifier on x86.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
llvm/trunk/test/CodeGen/X86/asm-modifier.ll
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=79961&r1=79960&r2=79961&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Mon Aug 24 19:16:14 2009
@@ -625,6 +625,10 @@
O << MO.getImm();
return false;
}
+ if (MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isSymbol()) {
+ printSymbolOperand(MO);
+ return false;
+ }
if (MO.isReg()) {
O << '(';
printOperand(MI, OpNo);
Modified: llvm/trunk/test/CodeGen/X86/asm-modifier.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/asm-modifier.ll?rev=79961&r1=79960&r2=79961&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/asm-modifier.ll (original)
+++ llvm/trunk/test/CodeGen/X86/asm-modifier.ll Mon Aug 24 19:16:14 2009
@@ -19,3 +19,23 @@
%asmtmp = tail call i16 asm "movw\09%gs:${1:a}, ${0:w}", "=r,ir,~{dirflag},~{fpsr},~{flags}"(i32 %address) nounwind ; <i16> [#uses=1]
ret i16 %asmtmp
}
+
+ at n = global i32 42 ; <i32*> [#uses=3]
+ at y = common global i32 0 ; <i32*> [#uses=3]
+
+define void @test3() nounwind {
+entry:
+; CHECK: test3:
+; CHECK: movl _n, %eax
+ call void asm sideeffect "movl ${0:a}, %eax", "ir,~{dirflag},~{fpsr},~{flags},~{eax}"(i32* @n) nounwind
+ ret void
+}
+
+define void @test4() nounwind {
+entry:
+; CHECK: test4:
+; CHECK: movl L_y$non_lazy_ptr, %ecx
+; CHECK: movl (%ecx), %eax
+ call void asm sideeffect "movl ${0:a}, %eax", "ir,~{dirflag},~{fpsr},~{flags},~{eax}"(i32* @y) nounwind
+ ret void
+}
More information about the llvm-commits
mailing list