[mips] Shorten predicate name.

llvm-svn: 169579
This commit is contained in:
Akira Hatanaka 2012-12-07 03:06:09 +00:00
parent c5dc055922
commit 97e179f9e4
5 changed files with 105 additions and 105 deletions

View File

@ -50,23 +50,23 @@ class Div64<SDNode op, bits<6> func, string instr_asm, InstrItinClass itin>:
multiclass Atomic2Ops64<PatFrag Op, string Opstr> {
def #NAME# : Atomic2Ops<Op, Opstr, CPU64Regs, CPURegs>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : Atomic2Ops<Op, Opstr, CPU64Regs, CPU64Regs>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let isCodeGenOnly = 1;
}
}
multiclass AtomicCmpSwap64<PatFrag Op, string Width> {
def #NAME# : AtomicCmpSwap<Op, Width, CPU64Regs, CPURegs>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : AtomicCmpSwap<Op, Width, CPU64Regs, CPU64Regs>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let isCodeGenOnly = 1;
}
}
}
let usesCustomInserter = 1, Predicates = [HasStandardEncoding],
let usesCustomInserter = 1, Predicates = [HasStdEnc],
DecoderNamespace = "Mips64" in {
defm ATOMIC_LOAD_ADD_I64 : Atomic2Ops64<atomic_load_add_64, "load_add_64">;
defm ATOMIC_LOAD_SUB_I64 : Atomic2Ops64<atomic_load_sub_64, "load_sub_64">;
@ -119,7 +119,7 @@ let Pattern = []<dag> in {
}
}
// Rotate Instructions
let Predicates = [HasMips64r2, HasStandardEncoding],
let Predicates = [HasMips64r2, HasStdEnc],
DecoderNamespace = "Mips64" in {
def DROTR : shift_rotate_imm64<0x3a, 0x01, "drotr", rotr>;
def DROTRV : shift_rotate_reg<0x16, 0x01, "drotrv", rotr, CPU64Regs>;
@ -154,15 +154,15 @@ defm SDR : StoreLeftRightM64<0x2d, "sdr", MipsSDR>;
/// Load-linked, Store-conditional
def LLD : LLBase<0x34, "lld", CPU64Regs, mem>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def LLD_P8 : LLBase<0x34, "lld", CPU64Regs, mem64>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let isCodeGenOnly = 1;
}
def SCD : SCBase<0x3c, "scd", CPU64Regs, mem>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def SCD_P8 : SCBase<0x3c, "scd", CPU64Regs, mem64>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let isCodeGenOnly = 1;
}
@ -207,7 +207,7 @@ def LEA_ADDiu64 : EffectiveAddress<0x19,"daddiu\t$rt, $addr", CPU64Regs, mem_ea_
}
let Uses = [SP_64], DecoderNamespace = "Mips64" in
def DynAlloc64 : EffectiveAddress<0x19,"daddiu\t$rt, $addr", CPU64Regs, mem_ea_64>,
Requires<[IsN64, HasStandardEncoding]>;
Requires<[IsN64, HasStdEnc]>;
let DecoderNamespace = "Mips64" in {
def RDHWR64 : ReadHardware<CPU64Regs, HWRegs64>;
@ -236,13 +236,13 @@ let isCodeGenOnly = 1, rs = 0, shamt = 0 in {
//===----------------------------------------------------------------------===//
// extended loads
let Predicates = [NotN64, HasStandardEncoding] in {
let Predicates = [NotN64, HasStdEnc] in {
def : MipsPat<(i64 (extloadi1 addr:$src)), (LB64 addr:$src)>;
def : MipsPat<(i64 (extloadi8 addr:$src)), (LB64 addr:$src)>;
def : MipsPat<(i64 (extloadi16 addr:$src)), (LH64 addr:$src)>;
def : MipsPat<(i64 (extloadi32 addr:$src)), (LW64 addr:$src)>;
}
let Predicates = [IsN64, HasStandardEncoding] in {
let Predicates = [IsN64, HasStdEnc] in {
def : MipsPat<(i64 (extloadi1 addr:$src)), (LB64_P8 addr:$src)>;
def : MipsPat<(i64 (extloadi8 addr:$src)), (LB64_P8 addr:$src)>;
def : MipsPat<(i64 (extloadi16 addr:$src)), (LH64_P8 addr:$src)>;
@ -295,12 +295,12 @@ defm : SetgeImmPats<CPU64Regs, SLTi64, SLTiu64>;
// select MipsDynAlloc
def : MipsPat<(MipsDynAlloc addr:$f), (DynAlloc64 addr:$f)>,
Requires<[IsN64, HasStandardEncoding]>;
Requires<[IsN64, HasStdEnc]>;
// truncate
def : MipsPat<(i32 (trunc CPU64Regs:$src)),
(SLL (EXTRACT_SUBREG CPU64Regs:$src, sub_32), 0)>,
Requires<[IsN64, HasStandardEncoding]>;
Requires<[IsN64, HasStdEnc]>;
// 32-to-64-bit extension
def : MipsPat<(i64 (anyext CPURegs:$src)), (SLL64_32 CPURegs:$src)>;

View File

@ -107,7 +107,7 @@ multiclass MovnPats<RegisterClass CRC, RegisterClass DRC, Instruction MOVNInst,
// Instantiation of instructions.
def MOVZ_I_I : CondMovIntInt<CPURegs, CPURegs, 0x0a, "movz">;
let Predicates = [HasStandardEncoding],
let Predicates = [HasStdEnc],
DecoderNamespace = "Mips64" in {
def MOVZ_I_I64 : CondMovIntInt<CPURegs, CPU64Regs, 0x0a, "movz">;
def MOVZ_I64_I : CondMovIntInt<CPU64Regs, CPURegs, 0x0a, "movz"> {
@ -119,7 +119,7 @@ let Predicates = [HasStandardEncoding],
}
def MOVN_I_I : CondMovIntInt<CPURegs, CPURegs, 0x0b, "movn">;
let Predicates = [HasStandardEncoding],
let Predicates = [HasStdEnc],
DecoderNamespace = "Mips64" in {
def MOVN_I_I64 : CondMovIntInt<CPURegs, CPU64Regs, 0x0b, "movn">;
def MOVN_I64_I : CondMovIntInt<CPU64Regs, CPURegs, 0x0b, "movn"> {
@ -132,21 +132,21 @@ let Predicates = [HasStandardEncoding],
def MOVZ_I_S : CondMovIntFP<CPURegs, FGR32, 16, 18, "movz.s">;
def MOVZ_I64_S : CondMovIntFP<CPU64Regs, FGR32, 16, 18, "movz.s">,
Requires<[HasMips64, HasStandardEncoding]> {
Requires<[HasMips64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
def MOVN_I_S : CondMovIntFP<CPURegs, FGR32, 16, 19, "movn.s">;
def MOVN_I64_S : CondMovIntFP<CPU64Regs, FGR32, 16, 19, "movn.s">,
Requires<[HasMips64, HasStandardEncoding]> {
Requires<[HasMips64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
let Predicates = [NotFP64bit, HasStandardEncoding] in {
let Predicates = [NotFP64bit, HasStdEnc] in {
def MOVZ_I_D32 : CondMovIntFP<CPURegs, AFGR64, 17, 18, "movz.d">;
def MOVN_I_D32 : CondMovIntFP<CPURegs, AFGR64, 17, 19, "movn.d">;
}
let Predicates = [IsFP64bit, HasStandardEncoding],
let Predicates = [IsFP64bit, HasStdEnc],
DecoderNamespace = "Mips64" in {
def MOVZ_I_D64 : CondMovIntFP<CPURegs, FGR64, 17, 18, "movz.d">;
def MOVZ_I64_D64 : CondMovIntFP<CPU64Regs, FGR64, 17, 18, "movz.d"> {
@ -160,24 +160,24 @@ let Predicates = [IsFP64bit, HasStandardEncoding],
def MOVT_I : CondMovFPInt<CPURegs, MipsCMovFP_T, 1, "movt">;
def MOVT_I64 : CondMovFPInt<CPU64Regs, MipsCMovFP_T, 1, "movt">,
Requires<[HasMips64, HasStandardEncoding]> {
Requires<[HasMips64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
def MOVF_I : CondMovFPInt<CPURegs, MipsCMovFP_F, 0, "movf">;
def MOVF_I64 : CondMovFPInt<CPU64Regs, MipsCMovFP_F, 0, "movf">,
Requires<[HasMips64, HasStandardEncoding]> {
Requires<[HasMips64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
def MOVT_S : CondMovFPFP<FGR32, MipsCMovFP_T, 16, 1, "movt.s">;
def MOVF_S : CondMovFPFP<FGR32, MipsCMovFP_F, 16, 0, "movf.s">;
let Predicates = [NotFP64bit, HasStandardEncoding] in {
let Predicates = [NotFP64bit, HasStdEnc] in {
def MOVT_D32 : CondMovFPFP<AFGR64, MipsCMovFP_T, 17, 1, "movt.d">;
def MOVF_D32 : CondMovFPFP<AFGR64, MipsCMovFP_F, 17, 0, "movf.d">;
}
let Predicates = [IsFP64bit, HasStandardEncoding],
let Predicates = [IsFP64bit, HasStdEnc],
DecoderNamespace = "Mips64" in {
def MOVT_D64 : CondMovFPFP<FGR64, MipsCMovFP_T, 17, 1, "movt.d">;
def MOVF_D64 : CondMovFPFP<FGR64, MipsCMovFP_F, 17, 0, "movf.d">;
@ -187,7 +187,7 @@ let Predicates = [IsFP64bit, HasStandardEncoding],
defm : MovzPats0<CPURegs, CPURegs, MOVZ_I_I, SLT, SLTu, SLTi, SLTiu>;
defm : MovzPats1<CPURegs, CPURegs, MOVZ_I_I, XOR>;
defm : MovzPats2<CPURegs, CPURegs, MOVZ_I_I, XORi>;
let Predicates = [HasMips64, HasStandardEncoding] in {
let Predicates = [HasMips64, HasStdEnc] in {
defm : MovzPats0<CPURegs, CPU64Regs, MOVZ_I_I64, SLT, SLTu, SLTi, SLTiu>;
defm : MovzPats0<CPU64Regs, CPURegs, MOVZ_I_I, SLT64, SLTu64, SLTi64,
SLTiu64>;
@ -202,7 +202,7 @@ let Predicates = [HasMips64, HasStandardEncoding] in {
}
defm : MovnPats<CPURegs, CPURegs, MOVN_I_I, XOR>;
let Predicates = [HasMips64, HasStandardEncoding] in {
let Predicates = [HasMips64, HasStdEnc] in {
defm : MovnPats<CPURegs, CPU64Regs, MOVN_I_I64, XOR>;
defm : MovnPats<CPU64Regs, CPURegs, MOVN_I64_I, XOR64>;
defm : MovnPats<CPU64Regs, CPU64Regs, MOVN_I64_I64, XOR64>;
@ -211,19 +211,19 @@ let Predicates = [HasMips64, HasStandardEncoding] in {
defm : MovzPats0<CPURegs, FGR32, MOVZ_I_S, SLT, SLTu, SLTi, SLTiu>;
defm : MovzPats1<CPURegs, FGR32, MOVZ_I_S, XOR>;
defm : MovnPats<CPURegs, FGR32, MOVN_I_S, XOR>;
let Predicates = [HasMips64, HasStandardEncoding] in {
let Predicates = [HasMips64, HasStdEnc] in {
defm : MovzPats0<CPU64Regs, FGR32, MOVZ_I_S, SLT64, SLTu64, SLTi64,
SLTiu64>;
defm : MovzPats1<CPU64Regs, FGR32, MOVZ_I64_S, XOR64>;
defm : MovnPats<CPU64Regs, FGR32, MOVN_I64_S, XOR64>;
}
let Predicates = [NotFP64bit, HasStandardEncoding] in {
let Predicates = [NotFP64bit, HasStdEnc] in {
defm : MovzPats0<CPURegs, AFGR64, MOVZ_I_D32, SLT, SLTu, SLTi, SLTiu>;
defm : MovzPats1<CPURegs, AFGR64, MOVZ_I_D32, XOR>;
defm : MovnPats<CPURegs, AFGR64, MOVN_I_D32, XOR>;
}
let Predicates = [IsFP64bit, HasStandardEncoding] in {
let Predicates = [IsFP64bit, HasStdEnc] in {
defm : MovzPats0<CPURegs, FGR64, MOVZ_I_D64, SLT, SLTu, SLTi, SLTiu>;
defm : MovzPats0<CPU64Regs, FGR64, MOVZ_I_D64, SLT64, SLTu64, SLTi64,
SLTiu64>;

View File

@ -121,15 +121,15 @@ class FPIdxStore<bits<6> funct, string opstr, RegisterClass DRC,
multiclass FFR1_W_M<bits<6> funct, string opstr> {
def _S : FFR1<funct, 16, opstr, "w.s", FGR32, FGR32>;
def _D32 : FFR1<funct, 17, opstr, "w.d", FGR32, AFGR64>,
Requires<[NotFP64bit, HasStandardEncoding]>;
Requires<[NotFP64bit, HasStdEnc]>;
def _D64 : FFR1<funct, 17, opstr, "w.d", FGR32, FGR64>,
Requires<[IsFP64bit, HasStandardEncoding]> {
Requires<[IsFP64bit, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
}
// Instructions that convert an FP value to 64-bit fixed point.
let Predicates = [IsFP64bit, HasStandardEncoding], DecoderNamespace = "Mips64" in
let Predicates = [IsFP64bit, HasStdEnc], DecoderNamespace = "Mips64" in
multiclass FFR1_L_M<bits<6> funct, string opstr> {
def _S : FFR1<funct, 16, opstr, "l.s", FGR64, FGR32>;
def _D64 : FFR1<funct, 17, opstr, "l.d", FGR64, FGR64>;
@ -139,9 +139,9 @@ multiclass FFR1_L_M<bits<6> funct, string opstr> {
multiclass FFR1P_M<bits<6> funct, string opstr, SDNode OpNode> {
def _S : FFR1P<funct, 16, opstr, "s", FGR32, FGR32, OpNode>;
def _D32 : FFR1P<funct, 17, opstr, "d", AFGR64, AFGR64, OpNode>,
Requires<[NotFP64bit, HasStandardEncoding]>;
Requires<[NotFP64bit, HasStdEnc]>;
def _D64 : FFR1P<funct, 17, opstr, "d", FGR64, FGR64, OpNode>,
Requires<[IsFP64bit, HasStandardEncoding]> {
Requires<[IsFP64bit, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
}
@ -150,9 +150,9 @@ multiclass FFR2P_M<bits<6> funct, string opstr, SDNode OpNode, bit isComm = 0> {
let isCommutable = isComm in {
def _S : FFR2P<funct, 16, opstr, "s", FGR32, OpNode>;
def _D32 : FFR2P<funct, 17, opstr, "d", AFGR64, OpNode>,
Requires<[NotFP64bit, HasStandardEncoding]>;
Requires<[NotFP64bit, HasStdEnc]>;
def _D64 : FFR2P<funct, 17, opstr, "d", FGR64, OpNode>,
Requires<[IsFP64bit, HasStandardEncoding]> {
Requires<[IsFP64bit, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
}
@ -189,13 +189,13 @@ def CVT_S_W : FFR1<0x20, 20, "cvt", "s.w", FGR32, FGR32>, NeverHasSideEffects;
def CVT_L_S : FFR1<0x25, 16, "cvt", "l.s", FGR64, FGR32>, NeverHasSideEffects;
def CVT_L_D64: FFR1<0x25, 17, "cvt", "l.d", FGR64, FGR64>, NeverHasSideEffects;
let Predicates = [NotFP64bit, HasStandardEncoding], neverHasSideEffects = 1 in {
let Predicates = [NotFP64bit, HasStdEnc], neverHasSideEffects = 1 in {
def CVT_S_D32 : FFR1<0x20, 17, "cvt", "s.d", FGR32, AFGR64>;
def CVT_D32_W : FFR1<0x21, 20, "cvt", "d.w", AFGR64, FGR32>;
def CVT_D32_S : FFR1<0x21, 16, "cvt", "d.s", AFGR64, FGR32>;
}
let Predicates = [IsFP64bit, HasStandardEncoding], DecoderNamespace = "Mips64",
let Predicates = [IsFP64bit, HasStdEnc], DecoderNamespace = "Mips64",
neverHasSideEffects = 1 in {
def CVT_S_D64 : FFR1<0x20, 17, "cvt", "s.d", FGR32, FGR64>;
def CVT_S_L : FFR1<0x20, 21, "cvt", "s.l", FGR32, FGR64>;
@ -204,7 +204,7 @@ let Predicates = [IsFP64bit, HasStandardEncoding], DecoderNamespace = "Mips64",
def CVT_D64_L : FFR1<0x21, 21, "cvt", "d.l", FGR64, FGR64>;
}
let Predicates = [NoNaNsFPMath, HasStandardEncoding] in {
let Predicates = [NoNaNsFPMath, HasStdEnc] in {
defm FABS : FFR1P_M<0x5, "abs", fabs>;
defm FNEG : FFR1P_M<0x7, "neg", fneg>;
}
@ -247,14 +247,14 @@ def DMTC1 : FFRGPR<0x05, (outs FGR64:$fs), (ins CPU64Regs:$rt),
def FMOV_S : FFR1<0x6, 16, "mov", "s", FGR32, FGR32>;
def FMOV_D32 : FFR1<0x6, 17, "mov", "d", AFGR64, AFGR64>,
Requires<[NotFP64bit, HasStandardEncoding]>;
Requires<[NotFP64bit, HasStdEnc]>;
def FMOV_D64 : FFR1<0x6, 17, "mov", "d", FGR64, FGR64>,
Requires<[IsFP64bit, HasStandardEncoding]> {
Requires<[IsFP64bit, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
/// Floating Point Memory Instructions
let Predicates = [IsN64, HasStandardEncoding], DecoderNamespace = "Mips64" in {
let Predicates = [IsN64, HasStdEnc], DecoderNamespace = "Mips64" in {
def LWC1_P8 : FPLoad<0x31, "lwc1", FGR32, mem64>;
def SWC1_P8 : FPStore<0x39, "swc1", FGR32, mem64>;
def LDC164_P8 : FPLoad<0x35, "ldc1", FGR64, mem64> {
@ -265,40 +265,40 @@ let Predicates = [IsN64, HasStandardEncoding], DecoderNamespace = "Mips64" in {
}
}
let Predicates = [NotN64, HasStandardEncoding] in {
let Predicates = [NotN64, HasStdEnc] in {
def LWC1 : FPLoad<0x31, "lwc1", FGR32, mem>;
def SWC1 : FPStore<0x39, "swc1", FGR32, mem>;
}
let Predicates = [NotN64, HasMips64, HasStandardEncoding],
let Predicates = [NotN64, HasMips64, HasStdEnc],
DecoderNamespace = "Mips64" in {
def LDC164 : FPLoad<0x35, "ldc1", FGR64, mem>;
def SDC164 : FPStore<0x3d, "sdc1", FGR64, mem>;
}
let Predicates = [NotN64, NotMips64, HasStandardEncoding] in {
let Predicates = [NotN64, NotMips64, HasStdEnc] in {
def LDC1 : FPLoad<0x35, "ldc1", AFGR64, mem>;
def SDC1 : FPStore<0x3d, "sdc1", AFGR64, mem>;
}
// Indexed loads and stores.
let Predicates = [HasFPIdx, HasStandardEncoding] in {
let Predicates = [HasFPIdx, HasStdEnc] in {
def LWXC1 : FPIdxLoad<0x0, "lwxc1", FGR32, CPURegs, load>;
def SWXC1 : FPIdxStore<0x8, "swxc1", FGR32, CPURegs, store>;
}
let Predicates = [HasMips32r2, NotMips64, HasStandardEncoding] in {
let Predicates = [HasMips32r2, NotMips64, HasStdEnc] in {
def LDXC1 : FPIdxLoad<0x1, "ldxc1", AFGR64, CPURegs, load>;
def SDXC1 : FPIdxStore<0x9, "sdxc1", AFGR64, CPURegs, store>;
}
let Predicates = [HasMips64, NotN64, HasStandardEncoding], DecoderNamespace="Mips64" in {
let Predicates = [HasMips64, NotN64, HasStdEnc], DecoderNamespace="Mips64" in {
def LDXC164 : FPIdxLoad<0x1, "ldxc1", FGR64, CPURegs, load>;
def SDXC164 : FPIdxStore<0x9, "sdxc1", FGR64, CPURegs, store>;
}
// n64
let Predicates = [IsN64, HasStandardEncoding], isCodeGenOnly=1 in {
let Predicates = [IsN64, HasStdEnc], isCodeGenOnly=1 in {
def LWXC1_P8 : FPIdxLoad<0x0, "lwxc1", FGR32, CPU64Regs, load>;
def LDXC164_P8 : FPIdxLoad<0x1, "ldxc1", FGR64, CPU64Regs, load>;
def SWXC1_P8 : FPIdxStore<0x8, "swxc1", FGR32, CPU64Regs, store>;
@ -306,12 +306,12 @@ let Predicates = [IsN64, HasStandardEncoding], isCodeGenOnly=1 in {
}
// Load/store doubleword indexed unaligned.
let Predicates = [NotMips64, HasStandardEncoding] in {
let Predicates = [NotMips64, HasStdEnc] in {
def LUXC1 : FPIdxLoad<0x5, "luxc1", AFGR64, CPURegs>;
def SUXC1 : FPIdxStore<0xd, "suxc1", AFGR64, CPURegs>;
}
let Predicates = [HasMips64, HasStandardEncoding],
let Predicates = [HasMips64, HasStdEnc],
DecoderNamespace="Mips64" in {
def LUXC164 : FPIdxLoad<0x5, "luxc1", FGR64, CPURegs>;
def SUXC164 : FPIdxStore<0xd, "suxc1", FGR64, CPURegs>;
@ -323,32 +323,32 @@ defm FDIV : FFR2P_M<0x03, "div", fdiv>;
defm FMUL : FFR2P_M<0x02, "mul", fmul, 1>;
defm FSUB : FFR2P_M<0x01, "sub", fsub>;
let Predicates = [HasMips32r2, HasStandardEncoding] in {
let Predicates = [HasMips32r2, HasStdEnc] in {
def MADD_S : FMADDSUB<0x4, 0, "madd", "s", fadd, FGR32>;
def MSUB_S : FMADDSUB<0x5, 0, "msub", "s", fsub, FGR32>;
}
let Predicates = [HasMips32r2, NoNaNsFPMath, HasStandardEncoding] in {
let Predicates = [HasMips32r2, NoNaNsFPMath, HasStdEnc] in {
def NMADD_S : FNMADDSUB<0x6, 0, "nmadd", "s", fadd, FGR32>;
def NMSUB_S : FNMADDSUB<0x7, 0, "nmsub", "s", fsub, FGR32>;
}
let Predicates = [HasMips32r2, NotFP64bit, HasStandardEncoding] in {
let Predicates = [HasMips32r2, NotFP64bit, HasStdEnc] in {
def MADD_D32 : FMADDSUB<0x4, 1, "madd", "d", fadd, AFGR64>;
def MSUB_D32 : FMADDSUB<0x5, 1, "msub", "d", fsub, AFGR64>;
}
let Predicates = [HasMips32r2, NotFP64bit, NoNaNsFPMath, HasStandardEncoding] in {
let Predicates = [HasMips32r2, NotFP64bit, NoNaNsFPMath, HasStdEnc] in {
def NMADD_D32 : FNMADDSUB<0x6, 1, "nmadd", "d", fadd, AFGR64>;
def NMSUB_D32 : FNMADDSUB<0x7, 1, "nmsub", "d", fsub, AFGR64>;
}
let Predicates = [HasMips32r2, IsFP64bit, HasStandardEncoding], isCodeGenOnly=1 in {
let Predicates = [HasMips32r2, IsFP64bit, HasStdEnc], isCodeGenOnly=1 in {
def MADD_D64 : FMADDSUB<0x4, 1, "madd", "d", fadd, FGR64>;
def MSUB_D64 : FMADDSUB<0x5, 1, "msub", "d", fsub, FGR64>;
}
let Predicates = [HasMips32r2, IsFP64bit, NoNaNsFPMath, HasStandardEncoding],
let Predicates = [HasMips32r2, IsFP64bit, NoNaNsFPMath, HasStdEnc],
isCodeGenOnly=1 in {
def NMADD_D64 : FNMADDSUB<0x6, 1, "nmadd", "d", fadd, FGR64>;
def NMSUB_D64 : FNMADDSUB<0x7, 1, "nmsub", "d", fsub, FGR64>;
@ -407,9 +407,9 @@ class FCMP<bits<5> fmt, RegisterClass RC, string typestr> :
let Defs=[FCR31] in {
def FCMP_S32 : FCMP<0x10, FGR32, "s">;
def FCMP_D32 : FCMP<0x11, AFGR64, "d">,
Requires<[NotFP64bit, HasStandardEncoding]>;
Requires<[NotFP64bit, HasStdEnc]>;
def FCMP_D64 : FCMP<0x11, FGR64, "d">,
Requires<[IsFP64bit, HasStandardEncoding]> {
Requires<[IsFP64bit, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
}
@ -444,7 +444,7 @@ def : MipsPat<(f32 fpimm0neg), (FNEG_S (MTC1 ZERO))>;
def : MipsPat<(f32 (sint_to_fp CPURegs:$src)), (CVT_S_W (MTC1 CPURegs:$src))>;
def : MipsPat<(i32 (fp_to_sint FGR32:$src)), (MFC1 (TRUNC_W_S FGR32:$src))>;
let Predicates = [NotFP64bit, HasStandardEncoding] in {
let Predicates = [NotFP64bit, HasStdEnc] in {
def : MipsPat<(f64 (sint_to_fp CPURegs:$src)),
(CVT_D32_W (MTC1 CPURegs:$src))>;
def : MipsPat<(i32 (fp_to_sint AFGR64:$src)),
@ -453,7 +453,7 @@ let Predicates = [NotFP64bit, HasStandardEncoding] in {
def : MipsPat<(f64 (fextend FGR32:$src)), (CVT_D32_S FGR32:$src)>;
}
let Predicates = [IsFP64bit, HasStandardEncoding] in {
let Predicates = [IsFP64bit, HasStdEnc] in {
def : MipsPat<(f64 fpimm0), (DMTC1 ZERO_64)>;
def : MipsPat<(f64 fpimm0neg), (FNEG_D64 (DMTC1 ZERO_64))>;

View File

@ -76,7 +76,7 @@ class MipsInst<dag outs, dag ins, string asmstr, list<dag> pattern,
class InstSE<dag outs, dag ins, string asmstr, list<dag> pattern,
InstrItinClass itin, Format f>:
MipsInst<outs, ins, asmstr, pattern, itin, f> {
let Predicates = [HasStandardEncoding];
let Predicates = [HasStdEnc];
}
// Mips Pseudo Instructions Format
@ -89,7 +89,7 @@ class MipsPseudo<dag outs, dag ins, string asmstr, list<dag> pattern>:
// Mips32/64 Pseudo Instruction Format
class PseudoSE<dag outs, dag ins, string asmstr, list<dag> pattern>:
MipsPseudo<outs, ins, asmstr, pattern> {
let Predicates = [HasStandardEncoding];
let Predicates = [HasStdEnc];
}
// Pseudo-instructions for alternate assembly syntax (never used by codegen).

View File

@ -172,11 +172,11 @@ def RelocPIC : Predicate<"TM.getRelocationModel() == Reloc::PIC_">,
AssemblerPredicate<"FeatureMips32">;
def NoNaNsFPMath : Predicate<"TM.Options.NoNaNsFPMath">,
AssemblerPredicate<"FeatureMips32">;
def HasStandardEncoding : Predicate<"Subtarget.hasStandardEncoding()">,
AssemblerPredicate<"!FeatureMips16">;
def HasStdEnc : Predicate<"Subtarget.hasStandardEncoding()">,
AssemblerPredicate<"!FeatureMips16">;
class MipsPat<dag pattern, dag result> : Pat<pattern, result> {
let Predicates = [HasStandardEncoding];
let Predicates = [HasStdEnc];
}
class IsBranch {
@ -461,9 +461,9 @@ class StoreM<bits<6> op, string instr_asm, PatFrag OpNode, RegisterClass RC,
multiclass LoadM32<bits<6> op, string instr_asm, PatFrag OpNode,
bit Pseudo = 0> {
def #NAME# : LoadM<op, instr_asm, OpNode, CPURegs, mem, Pseudo>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : LoadM<op, instr_asm, OpNode, CPURegs, mem64, Pseudo>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
let isCodeGenOnly = 1;
}
@ -473,9 +473,9 @@ multiclass LoadM32<bits<6> op, string instr_asm, PatFrag OpNode,
multiclass LoadM64<bits<6> op, string instr_asm, PatFrag OpNode,
bit Pseudo = 0> {
def #NAME# : LoadM<op, instr_asm, OpNode, CPU64Regs, mem, Pseudo>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : LoadM<op, instr_asm, OpNode, CPU64Regs, mem64, Pseudo>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
let isCodeGenOnly = 1;
}
@ -485,9 +485,9 @@ multiclass LoadM64<bits<6> op, string instr_asm, PatFrag OpNode,
multiclass StoreM32<bits<6> op, string instr_asm, PatFrag OpNode,
bit Pseudo = 0> {
def #NAME# : StoreM<op, instr_asm, OpNode, CPURegs, mem, Pseudo>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : StoreM<op, instr_asm, OpNode, CPURegs, mem64, Pseudo>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
let isCodeGenOnly = 1;
}
@ -497,9 +497,9 @@ multiclass StoreM32<bits<6> op, string instr_asm, PatFrag OpNode,
multiclass StoreM64<bits<6> op, string instr_asm, PatFrag OpNode,
bit Pseudo = 0> {
def #NAME# : StoreM<op, instr_asm, OpNode, CPU64Regs, mem, Pseudo>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : StoreM<op, instr_asm, OpNode, CPU64Regs, mem64, Pseudo>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
let isCodeGenOnly = 1;
}
@ -524,9 +524,9 @@ class StoreLeftRight<bits<6> op, string instr_asm, SDNode OpNode,
// 32-bit load left/right.
multiclass LoadLeftRightM32<bits<6> op, string instr_asm, SDNode OpNode> {
def #NAME# : LoadLeftRight<op, instr_asm, OpNode, CPURegs, mem>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : LoadLeftRight<op, instr_asm, OpNode, CPURegs, mem64>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
let isCodeGenOnly = 1;
}
@ -535,9 +535,9 @@ multiclass LoadLeftRightM32<bits<6> op, string instr_asm, SDNode OpNode> {
// 64-bit load left/right.
multiclass LoadLeftRightM64<bits<6> op, string instr_asm, SDNode OpNode> {
def #NAME# : LoadLeftRight<op, instr_asm, OpNode, CPU64Regs, mem>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : LoadLeftRight<op, instr_asm, OpNode, CPU64Regs, mem64>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
let isCodeGenOnly = 1;
}
@ -546,9 +546,9 @@ multiclass LoadLeftRightM64<bits<6> op, string instr_asm, SDNode OpNode> {
// 32-bit store left/right.
multiclass StoreLeftRightM32<bits<6> op, string instr_asm, SDNode OpNode> {
def #NAME# : StoreLeftRight<op, instr_asm, OpNode, CPURegs, mem>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : StoreLeftRight<op, instr_asm, OpNode, CPURegs, mem64>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
let isCodeGenOnly = 1;
}
@ -557,9 +557,9 @@ multiclass StoreLeftRightM32<bits<6> op, string instr_asm, SDNode OpNode> {
// 64-bit store left/right.
multiclass StoreLeftRightM64<bits<6> op, string instr_asm, SDNode OpNode> {
def #NAME# : StoreLeftRight<op, instr_asm, OpNode, CPU64Regs, mem>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : StoreLeftRight<op, instr_asm, OpNode, CPU64Regs, mem64>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
let isCodeGenOnly = 1;
}
@ -627,7 +627,7 @@ class UncondBranch<bits<6> op, string instr_asm>:
let isTerminator = 1;
let isBarrier = 1;
let hasDelaySlot = 1;
let Predicates = [RelocPIC, HasStandardEncoding];
let Predicates = [RelocPIC, HasStdEnc];
let Defs = [AT];
}
@ -741,7 +741,7 @@ class CountLeading0<bits<6> func, string instr_asm, RegisterClass RC>:
FR<0x1c, func, (outs RC:$rd), (ins RC:$rs),
!strconcat(instr_asm, "\t$rd, $rs"),
[(set RC:$rd, (ctlz RC:$rs))], IIAlu>,
Requires<[HasBitCount, HasStandardEncoding]> {
Requires<[HasBitCount, HasStdEnc]> {
let shamt = 0;
let rt = rd;
}
@ -750,7 +750,7 @@ class CountLeading1<bits<6> func, string instr_asm, RegisterClass RC>:
FR<0x1c, func, (outs RC:$rd), (ins RC:$rs),
!strconcat(instr_asm, "\t$rd, $rs"),
[(set RC:$rd, (ctlz (not RC:$rs)))], IIAlu>,
Requires<[HasBitCount, HasStandardEncoding]> {
Requires<[HasBitCount, HasStdEnc]> {
let shamt = 0;
let rt = rd;
}
@ -763,7 +763,7 @@ class SignExtInReg<bits<5> sa, string instr_asm, ValueType vt,
[(set RC:$rd, (sext_inreg RC:$rt, vt))], NoItinerary> {
let rs = 0;
let shamt = sa;
let Predicates = [HasSEInReg, HasStandardEncoding];
let Predicates = [HasSEInReg, HasStdEnc];
}
// Subword Swap
@ -772,7 +772,7 @@ class SubwordSwap<bits<6> func, bits<5> sa, string instr_asm, RegisterClass RC>:
!strconcat(instr_asm, "\t$rd, $rt"), [], NoItinerary> {
let rs = 0;
let shamt = sa;
let Predicates = [HasSwap, HasStandardEncoding];
let Predicates = [HasSwap, HasStdEnc];
let neverHasSideEffects = 1;
}
@ -793,7 +793,7 @@ class ExtBase<bits<6> _funct, string instr_asm, RegisterClass RC>:
bits<5> sz;
let rd = sz;
let shamt = pos;
let Predicates = [HasMips32r2, HasStandardEncoding];
let Predicates = [HasMips32r2, HasStdEnc];
}
class InsBase<bits<6> _funct, string instr_asm, RegisterClass RC>:
@ -806,7 +806,7 @@ class InsBase<bits<6> _funct, string instr_asm, RegisterClass RC>:
bits<5> sz;
let rd = sz;
let shamt = pos;
let Predicates = [HasMips32r2, HasStandardEncoding];
let Predicates = [HasMips32r2, HasStdEnc];
let Constraints = "$src = $rt";
}
@ -819,9 +819,9 @@ class Atomic2Ops<PatFrag Op, string Opstr, RegisterClass DRC,
multiclass Atomic2Ops32<PatFrag Op, string Opstr> {
def #NAME# : Atomic2Ops<Op, Opstr, CPURegs, CPURegs>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : Atomic2Ops<Op, Opstr, CPURegs, CPU64Regs>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
}
@ -835,9 +835,9 @@ class AtomicCmpSwap<PatFrag Op, string Width, RegisterClass DRC,
multiclass AtomicCmpSwap32<PatFrag Op, string Width> {
def #NAME# : AtomicCmpSwap<Op, Width, CPURegs, CPURegs>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def _P8 : AtomicCmpSwap<Op, Width, CPURegs, CPU64Regs>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
}
@ -964,7 +964,7 @@ def SRLV : shift_rotate_reg<0x06, 0x00, "srlv", srl, CPURegs>;
def SRAV : shift_rotate_reg<0x07, 0x00, "srav", sra, CPURegs>;
// Rotate Instructions
let Predicates = [HasMips32r2, HasStandardEncoding] in {
let Predicates = [HasMips32r2, HasStdEnc] in {
def ROTR : shift_rotate_imm32<0x02, 0x01, "rotr", rotr>;
def ROTRV : shift_rotate_reg<0x06, 0x01, "rotrv", rotr, CPURegs>;
}
@ -999,22 +999,22 @@ def SYNC : InstSE<(outs), (ins i32imm:$stype), "sync $stype",
/// Load-linked, Store-conditional
def LL : LLBase<0x30, "ll", CPURegs, mem>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def LL_P8 : LLBase<0x30, "ll", CPURegs, mem64>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
def SC : SCBase<0x38, "sc", CPURegs, mem>,
Requires<[NotN64, HasStandardEncoding]>;
Requires<[NotN64, HasStdEnc]>;
def SC_P8 : SCBase<0x38, "sc", CPURegs, mem64>,
Requires<[IsN64, HasStandardEncoding]> {
Requires<[IsN64, HasStdEnc]> {
let DecoderNamespace = "Mips64";
}
/// Jump and Branch Instructions
def J : JumpFJ<0x02, jmptarget, "j", br, bb>,
Requires<[RelocStatic, HasStandardEncoding]>, IsBranch;
Requires<[RelocStatic, HasStdEnc]>, IsBranch;
def JR : IndirectBranch<CPURegs>;
def B : UncondBranch<0x04, "b">;
def BEQ : CBranch<0x04, "beq", seteq, CPURegs>;
@ -1084,7 +1084,7 @@ def MSUBU : MArithR<5, "msubu", MipsMSubu>;
// MUL is a assembly macro in the current used ISAs. In recent ISA's
// it is a real instruction.
def MUL : ArithLogicR<0x1c, 0x02, "mul", mul, IIImul, CPURegs, 1>,
Requires<[HasStandardEncoding]>;
Requires<[HasStdEnc]>;
def RDHWR : ReadHardware<CPURegs, HWRegs>;
@ -1197,22 +1197,22 @@ def : MipsPat<(not CPURegs:$in),
(NOR CPURegs:$in, ZERO)>;
// extended loads
let Predicates = [NotN64, HasStandardEncoding] in {
let Predicates = [NotN64, HasStdEnc] in {
def : MipsPat<(i32 (extloadi1 addr:$src)), (LBu addr:$src)>;
def : MipsPat<(i32 (extloadi8 addr:$src)), (LBu addr:$src)>;
def : MipsPat<(i32 (extloadi16 addr:$src)), (LHu addr:$src)>;
}
let Predicates = [IsN64, HasStandardEncoding] in {
let Predicates = [IsN64, HasStdEnc] in {
def : MipsPat<(i32 (extloadi1 addr:$src)), (LBu_P8 addr:$src)>;
def : MipsPat<(i32 (extloadi8 addr:$src)), (LBu_P8 addr:$src)>;
def : MipsPat<(i32 (extloadi16 addr:$src)), (LHu_P8 addr:$src)>;
}
// peepholes
let Predicates = [NotN64, HasStandardEncoding] in {
let Predicates = [NotN64, HasStdEnc] in {
def : MipsPat<(store (i32 0), addr:$dst), (SW ZERO, addr:$dst)>;
}
let Predicates = [IsN64, HasStandardEncoding] in {
let Predicates = [IsN64, HasStdEnc] in {
def : MipsPat<(store (i32 0), addr:$dst), (SW_P8 ZERO, addr:$dst)>;
}