[llvm-commits] [llvm] r83572 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/ARM/t2-imm.ll
Anton Korobeynikov
asl at math.spbu.ru
Thu Oct 8 13:43:22 PDT 2009
Author: asl
Date: Thu Oct 8 15:43:22 2009
New Revision: 83572
URL: http://llvm.org/viewvc/llvm-project?rev=83572&view=rev
Log:
Use lower16 / upper16 imm modifiers to asmprint 32-bit imms splitted via movt/movw pair.
Modified:
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/trunk/test/CodeGen/ARM/t2-imm.ll
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=83572&r1=83571&r2=83572&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Thu Oct 8 15:43:22 2009
@@ -329,13 +329,14 @@
}
case MachineOperand::MO_Immediate: {
int64_t Imm = MO.getImm();
+ O << '#';
if (Modifier) {
if (strcmp(Modifier, "lo16") == 0)
- Imm = Imm & 0xffffLL;
+ O << ":lower16:";
else if (strcmp(Modifier, "hi16") == 0)
- Imm = (Imm & 0xffff0000LL) >> 16;
+ O << ":upper16:";
}
- O << '#' << Imm;
+ O << Imm;
break;
}
case MachineOperand::MO_MachineBasicBlock:
Modified: llvm/trunk/test/CodeGen/ARM/t2-imm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/t2-imm.ll?rev=83572&r1=83571&r2=83572&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/t2-imm.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/t2-imm.ll Thu Oct 8 15:43:22 2009
@@ -2,8 +2,8 @@
define i32 @f6(i32 %a) {
; CHECK:f6
-; CHECK: movw r0, #1123
-; CHECK: movt r0, #1000
+; CHECK: movw r0, #:lower16:65537123
+; CHECK: movt r0, #:upper16:65537123
%tmp = add i32 0, 65537123
ret i32 %tmp
}
More information about the llvm-commits
mailing list