mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-09 16:45:03 +00:00
[mips] Use predicates to guard instructions using accumulator registers instead
of relying on AddedComplexity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
adb1297d49
commit
397f6da28c
@ -453,7 +453,6 @@ class MULT_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
|
||||
string AsmString = !strconcat(instr_asm, "\t$ac, $rs, $rt");
|
||||
list<dag> Pattern = [(set ACC64DSPOpnd:$ac, (OpNode GPR32Opnd:$rs, GPR32Opnd:$rt))];
|
||||
InstrItinClass Itinerary = itin;
|
||||
int AddedComplexity = 20;
|
||||
bit isCommutable = 1;
|
||||
}
|
||||
|
||||
@ -465,7 +464,6 @@ class MADD_DESC_BASE<string instr_asm, SDPatternOperator OpNode,
|
||||
list<dag> Pattern = [(set ACC64DSPOpnd:$ac,
|
||||
(OpNode GPR32Opnd:$rs, GPR32Opnd:$rt, ACC64DSPOpnd:$acin))];
|
||||
InstrItinClass Itinerary = itin;
|
||||
int AddedComplexity = 20;
|
||||
string Constraints = "$acin = $ac";
|
||||
}
|
||||
|
||||
@ -476,7 +474,6 @@ class MFHI_DESC_BASE<string instr_asm, RegisterOperand RO, SDNode OpNode,
|
||||
string AsmString = !strconcat(instr_asm, "\t$rd, $ac");
|
||||
list<dag> Pattern = [(set GPR32Opnd:$rd, (OpNode RO:$ac))];
|
||||
InstrItinClass Itinerary = itin;
|
||||
int AddedComplexity = 20;
|
||||
}
|
||||
|
||||
class MTHI_DESC_BASE<string instr_asm, RegisterOperand RO, InstrItinClass itin> {
|
||||
|
@ -1030,21 +1030,13 @@ def MULT : MMRel, Mult<"mult", IIImult, GPR32Opnd, [HI0, LO0]>,
|
||||
MULT_FM<0, 0x18>;
|
||||
def MULTu : MMRel, Mult<"multu", IIImult, GPR32Opnd, [HI0, LO0]>,
|
||||
MULT_FM<0, 0x19>;
|
||||
def PseudoMULT : MultDivPseudo<MULT, ACC64, GPR32Opnd, MipsMult, IIImult>;
|
||||
def PseudoMULTu : MultDivPseudo<MULTu, ACC64, GPR32Opnd, MipsMultu, IIImult>;
|
||||
def SDIV : Div<"div", IIIdiv, GPR32Opnd, [HI0, LO0]>, MULT_FM<0, 0x1a>;
|
||||
def UDIV : Div<"divu", IIIdiv, GPR32Opnd, [HI0, LO0]>, MULT_FM<0, 0x1b>;
|
||||
def PseudoSDIV : MultDivPseudo<SDIV, ACC64, GPR32Opnd, MipsDivRem, IIIdiv,
|
||||
0, 1, 1>;
|
||||
def PseudoUDIV : MultDivPseudo<UDIV, ACC64, GPR32Opnd, MipsDivRemU, IIIdiv,
|
||||
0, 1, 1>;
|
||||
|
||||
def MTHI : MMRel, MoveToLOHI<"mthi", GPR32Opnd, [HI0]>, MTLO_FM<0x11>;
|
||||
def MTLO : MMRel, MoveToLOHI<"mtlo", GPR32Opnd, [LO0]>, MTLO_FM<0x13>;
|
||||
def MFHI : MMRel, MoveFromLOHI<"mfhi", GPR32Opnd, AC0>, MFLO_FM<0x10>;
|
||||
def MFLO : MMRel, MoveFromLOHI<"mflo", GPR32Opnd, AC0>, MFLO_FM<0x12>;
|
||||
def PseudoMFHI : PseudoMFLOHI<GPR32, ACC64, MipsMFHI>;
|
||||
def PseudoMFLO : PseudoMFLOHI<GPR32, ACC64, MipsMFLO>;
|
||||
|
||||
/// Sign Ext In Register Instructions.
|
||||
def SEB : MMRel, SignExtInReg<"seb", i8, GPR32Opnd>, SEB_FM<0x10, 0x20>;
|
||||
@ -1071,10 +1063,22 @@ def MADD : MMRel, MArithR<"madd", 1>, MULT_FM<0x1c, 0>;
|
||||
def MADDU : MMRel, MArithR<"maddu", 1>, MULT_FM<0x1c, 1>;
|
||||
def MSUB : MMRel, MArithR<"msub">, MULT_FM<0x1c, 4>;
|
||||
def MSUBU : MMRel, MArithR<"msubu">, MULT_FM<0x1c, 5>;
|
||||
|
||||
let Predicates = [HasStdEnc, NotDSP] in {
|
||||
def PseudoMULT : MultDivPseudo<MULT, ACC64, GPR32Opnd, MipsMult, IIImult>;
|
||||
def PseudoMULTu : MultDivPseudo<MULTu, ACC64, GPR32Opnd, MipsMultu, IIImult>;
|
||||
def PseudoMFHI : PseudoMFLOHI<GPR32, ACC64, MipsMFHI>;
|
||||
def PseudoMFLO : PseudoMFLOHI<GPR32, ACC64, MipsMFLO>;
|
||||
def PseudoMADD : MAddSubPseudo<MADD, MipsMAdd>;
|
||||
def PseudoMADDU : MAddSubPseudo<MADDU, MipsMAddu>;
|
||||
def PseudoMSUB : MAddSubPseudo<MSUB, MipsMSub>;
|
||||
def PseudoMSUBU : MAddSubPseudo<MSUBU, MipsMSubu>;
|
||||
}
|
||||
|
||||
def PseudoSDIV : MultDivPseudo<SDIV, ACC64, GPR32Opnd, MipsDivRem, IIIdiv,
|
||||
0, 1, 1>;
|
||||
def PseudoUDIV : MultDivPseudo<UDIV, ACC64, GPR32Opnd, MipsDivRemU, IIIdiv,
|
||||
0, 1, 1>;
|
||||
|
||||
def RDHWR : ReadHardware<GPR32Opnd, HWRegsOpnd>, RDHWR_FM;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user