[llvm-commits] [llvm] r157709 - in /llvm/trunk: lib/Target/Mips/MipsAsmPrinter.cpp test/CodeGen/Mips/inlineasm-operand-code.ll
Eric Christopher
echristo at apple.com
Wed May 30 12:05:20 PDT 2012
Author: echristo
Date: Wed May 30 14:05:19 2012
New Revision: 157709
URL: http://llvm.org/viewvc/llvm-project?rev=157709&view=rev
Log:
Add support for the mips inline asm 'm' output modifier.
Patch by Jack Carter.
Modified:
llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
llvm/trunk/test/CodeGen/Mips/inlineasm-operand-code.ll
Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=157709&r1=157708&r2=157709&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Wed May 30 14:05:19 2012
@@ -377,6 +377,11 @@
return true;
O << MO.getImm();
return false;
+ case 'm': // decimal const int minus 1
+ if ((MO.getType()) != MachineOperand::MO_Immediate)
+ return true;
+ O << MO.getImm() - 1;
+ return false;
}
}
Modified: llvm/trunk/test/CodeGen/Mips/inlineasm-operand-code.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/inlineasm-operand-code.ll?rev=157709&r1=157708&r2=157709&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/inlineasm-operand-code.ll (original)
+++ llvm/trunk/test/CodeGen/Mips/inlineasm-operand-code.ll Wed May 30 14:05:19 2012
@@ -23,5 +23,11 @@
;CHECK: #NO_APP
tail call i32 asm sideeffect "addi $0,$1,${2:d}", "=r,r,I"(i32 7, i32 -3) nounwind
+; m with -3
+;CHECK: #APP
+;CHECK: addi ${{[0-9]+}},${{[0-9]+}},-4
+;CHECK: #NO_APP
+ tail call i32 asm sideeffect "addi $0,$1,${2:m}", "=r,r,I"(i32 7, i32 -3) nounwind
+
ret i32 0
}
More information about the llvm-commits
mailing list