[llvm-commits] [llvm] r75201 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/ARM/2009-07-09-asm-p-constraint.ll
Bob Wilson
bob.wilson at apple.com
Thu Jul 9 16:55:07 PDT 2009
Author: bwilson
Date: Thu Jul 9 18:54:51 2009
New Revision: 75201
URL: http://llvm.org/viewvc/llvm-project?rev=75201&view=rev
Log:
Handle 'a' modifier on inline assembly operands.
This is part of the fix for pr4521.
Added:
llvm/trunk/test/CodeGen/ARM/2009-07-09-asm-p-constraint.ll
Modified:
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=75201&r1=75200&r2=75201&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Thu Jul 9 18:54:51 2009
@@ -907,8 +907,13 @@
switch (ExtraCode[0]) {
default: return true; // Unknown modifier.
- case 'a': // Don't print "#" before a global var name or constant.
- case 'c': // Don't print "$" before a global var name or constant.
+ case 'a': // Print as a memory address.
+ if (MI->getOperand(OpNum).isReg()) {
+ O << "[" << TRI->getAsmName(MI->getOperand(OpNum).getReg()) << "]";
+ return false;
+ }
+ // Fallthrough
+ case 'c': // Don't print "#" before an immediate operand.
printOperand(MI, OpNum, "no_hash");
return false;
case 'P': // Print a VFP double precision register.
Added: llvm/trunk/test/CodeGen/ARM/2009-07-09-asm-p-constraint.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-07-09-asm-p-constraint.ll?rev=75201&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2009-07-09-asm-p-constraint.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/2009-07-09-asm-p-constraint.ll Thu Jul 9 18:54:51 2009
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=arm -mattr=+v6
+
+define void @test(i8* %x) nounwind {
+entry:
+ call void asm sideeffect "pld\09${0:a}", "r,~{cc}"(i8* %x) nounwind
+ ret void
+}
More information about the llvm-commits
mailing list