mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Fix a few places where 32bit instructions/registerset were used on PPC64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133260 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
33ded7333d
commit
951cd021c1
@ -1870,7 +1870,11 @@ PPCTargetLowering::LowerFormalArguments_Darwin(
|
||||
InVals.push_back(FIN);
|
||||
if (ObjSize==1 || ObjSize==2) {
|
||||
if (GPR_idx != Num_GPR_Regs) {
|
||||
unsigned VReg = MF.addLiveIn(GPR[GPR_idx], &PPC::GPRCRegClass);
|
||||
unsigned VReg;
|
||||
if (isPPC64)
|
||||
VReg = MF.addLiveIn(GPR[GPR_idx], &PPC::G8RCRegClass);
|
||||
else
|
||||
VReg = MF.addLiveIn(GPR[GPR_idx], &PPC::GPRCRegClass);
|
||||
SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, PtrVT);
|
||||
SDValue Store = DAG.getTruncStore(Val.getValue(1), dl, Val, FIN,
|
||||
MachinePointerInfo(),
|
||||
@ -1889,7 +1893,11 @@ PPCTargetLowering::LowerFormalArguments_Darwin(
|
||||
// to memory. ArgVal will be address of the beginning of
|
||||
// the object.
|
||||
if (GPR_idx != Num_GPR_Regs) {
|
||||
unsigned VReg = MF.addLiveIn(GPR[GPR_idx], &PPC::GPRCRegClass);
|
||||
unsigned VReg;
|
||||
if (isPPC64)
|
||||
VReg = MF.addLiveIn(GPR[GPR_idx], &PPC::G8RCRegClass);
|
||||
else
|
||||
VReg = MF.addLiveIn(GPR[GPR_idx], &PPC::GPRCRegClass);
|
||||
int FI = MFI->CreateFixedObject(PtrByteSize, ArgOffset, true);
|
||||
SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
|
||||
SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, PtrVT);
|
||||
@ -4675,7 +4683,7 @@ PPCTargetLowering::EmitPartwordAtomicBinary(MachineInstr *MI,
|
||||
.addReg(TmpReg).addReg(MaskReg);
|
||||
BuildMI(BB, dl, TII->get(is64bit ? PPC::OR8 : PPC::OR), Tmp4Reg)
|
||||
.addReg(Tmp3Reg).addReg(Tmp2Reg);
|
||||
BuildMI(BB, dl, TII->get(PPC::STWCX))
|
||||
BuildMI(BB, dl, TII->get(is64bit ? PPC::STDCX : PPC::STWCX))
|
||||
.addReg(Tmp4Reg).addReg(ZeroReg).addReg(PtrReg);
|
||||
BuildMI(BB, dl, TII->get(PPC::BCC))
|
||||
.addImm(PPC::PRED_NE).addReg(PPC::CR0).addMBB(loopMBB);
|
||||
|
@ -504,6 +504,7 @@ void PPCRegisterInfo::lowerCRSpilling(MachineBasicBlock::iterator II,
|
||||
const TargetRegisterClass *RC = Subtarget.isPPC64() ? G8RC : GPRC;
|
||||
unsigned Reg = findScratchRegister(II, RS, RC, SPAdj);
|
||||
unsigned SrcReg = MI.getOperand(0).getReg();
|
||||
bool LP64 = Subtarget.isPPC64();
|
||||
|
||||
// We need to store the CR in the low 4-bits of the saved value. First, issue
|
||||
// an MFCRpsued to save all of the CRBits and, if needed, kill the SrcReg.
|
||||
@ -520,7 +521,7 @@ void PPCRegisterInfo::lowerCRSpilling(MachineBasicBlock::iterator II,
|
||||
.addImm(0)
|
||||
.addImm(31);
|
||||
|
||||
addFrameReference(BuildMI(MBB, II, dl, TII.get(PPC::STW))
|
||||
addFrameReference(BuildMI(MBB, II, dl, TII.get(LP64 ? PPC::STW8 : PPC::STW))
|
||||
.addReg(Reg, getKillRegState(MI.getOperand(1).getImm())),
|
||||
FrameIndex);
|
||||
|
||||
|
14
test/CodeGen/PowerPC/ppc64-crash.ll
Normal file
14
test/CodeGen/PowerPC/ppc64-crash.ll
Normal file
@ -0,0 +1,14 @@
|
||||
; RUN: llc %s -o -
|
||||
|
||||
; ModuleID = 'undo.c'
|
||||
target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
|
||||
target triple = "powerpc64-unknown-freebsd"
|
||||
|
||||
%struct.__sFILE = type {}
|
||||
%struct.pos_T = type { i64 }
|
||||
|
||||
; check that we're not copying stuff between R and X registers
|
||||
define internal void @serialize_pos(%struct.pos_T* byval %pos, %struct.__sFILE* %fp) nounwind {
|
||||
entry:
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue
Block a user