[llvm-commits] [llvm] r157057 - in /llvm/trunk: lib/Target/Mips/MipsAsmPrinter.cpp test/CodeGen/Mips/inlineasm-operand-code.ll
Eric Christopher
echristo at apple.com
Fri May 18 10:39:36 PDT 2012
Author: echristo
Date: Fri May 18 12:39:35 2012
New Revision: 157057
URL: http://llvm.org/viewvc/llvm-project?rev=157057&view=rev
Log:
Add support for the mips 'x' inline asm 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=157057&r1=157056&r2=157057&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Fri May 18 12:39:35 2012
@@ -383,6 +383,11 @@
return true;
O << "0x" << StringRef(utohexstr(MO.getImm())).lower();
return false;
+ case 'x': // hex const int (low 16 bits)
+ if ((MO.getType()) != MachineOperand::MO_Immediate)
+ return true;
+ O << "0x" << StringRef(utohexstr(MO.getImm() & 0xffff)).lower();
+ 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=157057&r1=157056&r2=157057&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/inlineasm-operand-code.ll (original)
+++ llvm/trunk/test/CodeGen/Mips/inlineasm-operand-code.ll Fri May 18 12:39:35 2012
@@ -11,5 +11,11 @@
;CHECK: #NO_APP
tail call i32 asm sideeffect "addi $0,$1,${2:X}", "=r,r,I"(i32 7, i32 -3) nounwind
+; x with -3
+;CHECK: #APP
+;CHECK: addi ${{[0-9]+}},${{[0-9]+}},0xfffd
+;CHECK: #NO_APP
+ tail call i32 asm sideeffect "addi $0,$1,${2:x}", "=r,r,I"(i32 7, i32 -3) nounwind
+
ret i32 0
}
More information about the llvm-commits
mailing list