Use lower16 / upper16 imm modifiers to asmprint 32-bit imms splitted via movt/movw pair.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83572 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2009-10-08 20:43:22 +00:00
parent 85d29e2de3
commit 632606c724
2 changed files with 6 additions and 5 deletions

View File

@ -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:

View File

@ -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
}