mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
Add support for copying registers. still needed: spilling and reloading them
llvm-svn: 26800
This commit is contained in:
parent
413bb13b27
commit
bf153651b1
@ -25,7 +25,7 @@ bool PPCInstrInfo::isMoveInstr(const MachineInstr& MI,
|
|||||||
unsigned& sourceReg,
|
unsigned& sourceReg,
|
||||||
unsigned& destReg) const {
|
unsigned& destReg) const {
|
||||||
MachineOpCode oc = MI.getOpcode();
|
MachineOpCode oc = MI.getOpcode();
|
||||||
if (oc == PPC::OR4 || oc == PPC::OR8 ||
|
if (oc == PPC::OR4 || oc == PPC::OR8 || oc == PPC::VOR ||
|
||||||
oc == PPC::OR4To8 || oc == PPC::OR8To4) { // or r1, r2, r2
|
oc == PPC::OR4To8 || oc == PPC::OR8To4) { // or r1, r2, r2
|
||||||
assert(MI.getNumOperands() == 3 &&
|
assert(MI.getNumOperands() == 3 &&
|
||||||
MI.getOperand(0).isRegister() &&
|
MI.getOperand(0).isRegister() &&
|
||||||
|
@ -1009,6 +1009,9 @@ def VRSQRTEFP : VXForm_2<330, (ops VRRC:$vD, VRRC:$vB),
|
|||||||
def VSUBFP : VXForm_1<74, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
|
def VSUBFP : VXForm_1<74, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
|
||||||
"vsubfp $vD, $vA, $vB", VecFP,
|
"vsubfp $vD, $vA, $vB", VecFP,
|
||||||
[(set VRRC:$vD, (fsub VRRC:$vA, VRRC:$vB))]>;
|
[(set VRRC:$vD, (fsub VRRC:$vA, VRRC:$vB))]>;
|
||||||
|
def VOR : VXForm_1<1156, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
|
||||||
|
"vor $vD, $vA, $vB", VecFP,
|
||||||
|
[]>;
|
||||||
def VXOR : VXForm_1<1220, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
|
def VXOR : VXForm_1<1220, (ops VRRC:$vD, VRRC:$vA, VRRC:$vB),
|
||||||
"vxor $vD, $vA, $vB", VecFP,
|
"vxor $vD, $vA, $vB", VecFP,
|
||||||
[]>;
|
[]>;
|
||||||
@ -1151,6 +1154,7 @@ def : Pat<(v4i32 (load xoaddr:$src)),
|
|||||||
def : Pat<(store (v4i32 VRRC:$rS), xoaddr:$dst),
|
def : Pat<(store (v4i32 VRRC:$rS), xoaddr:$dst),
|
||||||
(STVX (v4i32 VRRC:$rS), xoaddr:$dst)>;
|
(STVX (v4i32 VRRC:$rS), xoaddr:$dst)>;
|
||||||
|
|
||||||
|
|
||||||
// Same as above, but using a temporary. FIXME: implement temporaries :)
|
// Same as above, but using a temporary. FIXME: implement temporaries :)
|
||||||
/*
|
/*
|
||||||
def : Pattern<(xor GPRC:$in, imm:$imm),
|
def : Pattern<(xor GPRC:$in, imm:$imm),
|
||||||
|
@ -110,6 +110,8 @@ void PPCRegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
|
|||||||
BuildMI(MBB, MI, PPC::FMRD, 1, DestReg).addReg(SrcReg);
|
BuildMI(MBB, MI, PPC::FMRD, 1, DestReg).addReg(SrcReg);
|
||||||
} else if (RC == PPC::CRRCRegisterClass) {
|
} else if (RC == PPC::CRRCRegisterClass) {
|
||||||
BuildMI(MBB, MI, PPC::MCRF, 1, DestReg).addReg(SrcReg);
|
BuildMI(MBB, MI, PPC::MCRF, 1, DestReg).addReg(SrcReg);
|
||||||
|
} else if (RC == PPC::VRRCRegisterClass) {
|
||||||
|
BuildMI(MBB, MI, PPC::VOR, 2, DestReg).addReg(SrcReg).addReg(SrcReg);
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Attempt to copy register that is not GPR or FPR";
|
std::cerr << "Attempt to copy register that is not GPR or FPR";
|
||||||
abort();
|
abort();
|
||||||
|
Loading…
Reference in New Issue
Block a user