aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp7
-rw-r--r--test/CodeGen/ARM/t2-imm.ll4
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index bdaae22..1679e12 100644
--- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -329,13 +329,14 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
}
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:
diff --git a/test/CodeGen/ARM/t2-imm.ll b/test/CodeGen/ARM/t2-imm.ll
index 8b619bf..848a4df 100644
--- a/test/CodeGen/ARM/t2-imm.ll
+++ b/test/CodeGen/ARM/t2-imm.ll
@@ -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
}