mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
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:
parent
85d29e2de3
commit
632606c724
@ -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:
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user