mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
Emit the MOVT instruction only if the # LPads is > 64K.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a5871dc104
commit
15a1a226be
@ -5769,11 +5769,16 @@ EmitSjLjDispatchBlock(MachineInstr *MI, MachineBasicBlock *MBB) const {
|
||||
} else {
|
||||
unsigned VReg1 = MRI->createVirtualRegister(TRC);
|
||||
AddDefaultPred(BuildMI(DispatchBB, dl, TII->get(ARM::t2MOVi16), VReg1)
|
||||
.addImm(NumLPads & 0xFF));
|
||||
unsigned VReg2 = MRI->createVirtualRegister(TRC);
|
||||
AddDefaultPred(BuildMI(DispatchBB, dl, TII->get(ARM::t2MOVTi16), VReg2)
|
||||
.addReg(VReg1)
|
||||
.addImm(NumLPads >> 16));
|
||||
.addImm(NumLPads & 0xFFFF));
|
||||
|
||||
unsigned VReg2 = VReg1;
|
||||
if ((NumLPads & 0xFFFF0000) != 0) {
|
||||
VReg2 = MRI->createVirtualRegister(TRC);
|
||||
AddDefaultPred(BuildMI(DispatchBB, dl, TII->get(ARM::t2MOVTi16), VReg2)
|
||||
.addReg(VReg1)
|
||||
.addImm(NumLPads >> 16));
|
||||
}
|
||||
|
||||
AddDefaultPred(BuildMI(DispatchBB, dl, TII->get(ARM::t2CMPrr))
|
||||
.addReg(NewVReg1)
|
||||
.addReg(VReg2));
|
||||
@ -5885,11 +5890,16 @@ EmitSjLjDispatchBlock(MachineInstr *MI, MachineBasicBlock *MBB) const {
|
||||
} else {
|
||||
unsigned VReg1 = MRI->createVirtualRegister(TRC);
|
||||
AddDefaultPred(BuildMI(DispatchBB, dl, TII->get(ARM::MOVi16), VReg1)
|
||||
.addImm(NumLPads & 0xFF));
|
||||
unsigned VReg2 = MRI->createVirtualRegister(TRC);
|
||||
AddDefaultPred(BuildMI(DispatchBB, dl, TII->get(ARM::MOVTi16), VReg2)
|
||||
.addReg(VReg1)
|
||||
.addImm(NumLPads >> 16));
|
||||
.addImm(NumLPads & 0xFFFF));
|
||||
|
||||
unsigned VReg2 = VReg1;
|
||||
if ((NumLPads & 0xFFFF0000) != 0) {
|
||||
VReg2 = MRI->createVirtualRegister(TRC);
|
||||
AddDefaultPred(BuildMI(DispatchBB, dl, TII->get(ARM::MOVTi16), VReg2)
|
||||
.addReg(VReg1)
|
||||
.addImm(NumLPads >> 16));
|
||||
}
|
||||
|
||||
AddDefaultPred(BuildMI(DispatchBB, dl, TII->get(ARM::CMPrr))
|
||||
.addReg(NewVReg1)
|
||||
.addReg(VReg2));
|
||||
|
Loading…
Reference in New Issue
Block a user