mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-12 14:17:59 +00:00
Arm and thumb call instructions are also in different orders.
Fixes rdar://8782223 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122313 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b8602039f1
commit
c19aadb8b0
@ -1699,14 +1699,19 @@ bool ARMFastISel::ARMEmitLibcall(const Instruction *I, RTLIB::Libcall Call) {
|
|||||||
// TODO: Turn this into the table of arm call ops.
|
// TODO: Turn this into the table of arm call ops.
|
||||||
MachineInstrBuilder MIB;
|
MachineInstrBuilder MIB;
|
||||||
unsigned CallOpc;
|
unsigned CallOpc;
|
||||||
if(isThumb)
|
if(isThumb) {
|
||||||
CallOpc = Subtarget->isTargetDarwin() ? ARM::tBLXi_r9 : ARM::tBLXi;
|
CallOpc = Subtarget->isTargetDarwin() ? ARM::tBLXi_r9 : ARM::tBLXi;
|
||||||
else
|
// Explicitly adding the predicate here.
|
||||||
|
MIB = AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
|
||||||
|
TII.get(CallOpc)))
|
||||||
|
.addExternalSymbol(TLI.getLibcallName(Call));
|
||||||
|
} else {
|
||||||
CallOpc = Subtarget->isTargetDarwin() ? ARM::BLr9 : ARM::BL;
|
CallOpc = Subtarget->isTargetDarwin() ? ARM::BLr9 : ARM::BL;
|
||||||
// Explicitly adding the predicate here.
|
// Explicitly adding the predicate here.
|
||||||
MIB = AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
|
MIB = AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
|
||||||
TII.get(CallOpc)))
|
TII.get(CallOpc))
|
||||||
.addExternalSymbol(TLI.getLibcallName(Call));
|
.addExternalSymbol(TLI.getLibcallName(Call)));
|
||||||
|
}
|
||||||
|
|
||||||
// Add implicit physical register uses to the call.
|
// Add implicit physical register uses to the call.
|
||||||
for (unsigned i = 0, e = RegArgs.size(); i != e; ++i)
|
for (unsigned i = 0, e = RegArgs.size(); i != e; ++i)
|
||||||
@ -1813,15 +1818,21 @@ bool ARMFastISel::SelectCall(const Instruction *I) {
|
|||||||
// TODO: Turn this into the table of arm call ops.
|
// TODO: Turn this into the table of arm call ops.
|
||||||
MachineInstrBuilder MIB;
|
MachineInstrBuilder MIB;
|
||||||
unsigned CallOpc;
|
unsigned CallOpc;
|
||||||
if(isThumb)
|
|
||||||
CallOpc = Subtarget->isTargetDarwin() ? ARM::tBLXi_r9 : ARM::tBLXi;
|
|
||||||
else
|
|
||||||
CallOpc = Subtarget->isTargetDarwin() ? ARM::BLr9 : ARM::BL;
|
|
||||||
// Explicitly adding the predicate here.
|
// Explicitly adding the predicate here.
|
||||||
MIB = AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
|
if(isThumb) {
|
||||||
TII.get(CallOpc)))
|
CallOpc = Subtarget->isTargetDarwin() ? ARM::tBLXi_r9 : ARM::tBLXi;
|
||||||
.addGlobalAddress(GV, 0, 0);
|
// Explicitly adding the predicate here.
|
||||||
|
MIB = AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
|
||||||
|
TII.get(CallOpc)))
|
||||||
|
.addGlobalAddress(GV, 0, 0);
|
||||||
|
} else {
|
||||||
|
CallOpc = Subtarget->isTargetDarwin() ? ARM::BLr9 : ARM::BL;
|
||||||
|
// Explicitly adding the predicate here.
|
||||||
|
MIB = AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
|
||||||
|
TII.get(CallOpc))
|
||||||
|
.addGlobalAddress(GV, 0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
// Add implicit physical register uses to the call.
|
// Add implicit physical register uses to the call.
|
||||||
for (unsigned i = 0, e = RegArgs.size(); i != e; ++i)
|
for (unsigned i = 0, e = RegArgs.size(); i != e; ++i)
|
||||||
MIB.addReg(RegArgs[i]);
|
MIB.addReg(RegArgs[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user