/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Global Instruction Selector for the Mips target *|
|* *|
|* Automatically generated file, do not edit! *|
|* *|
\*===----------------------------------------------------------------------===*/
#ifdef GET_GLOBALISEL_PREDICATE_BITSET
const unsigned MAX_SUBTARGET_PREDICATES = 44;
using PredicateBitset = llvm::PredicateBitsetImpl<MAX_SUBTARGET_PREDICATES>;
#endif // ifdef GET_GLOBALISEL_PREDICATE_BITSET
#ifdef GET_GLOBALISEL_TEMPORARIES_DECL
mutable MatcherState State;
typedef ComplexRendererFns(MipsInstructionSelector::*ComplexMatcherMemFn)(MachineOperand &) const;
typedef void(MipsInstructionSelector::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr&) const;
const ISelInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ISelInfo;
static MipsInstructionSelector::ComplexMatcherMemFn ComplexPredicateFns[];
static MipsInstructionSelector::CustomRendererFn CustomRenderers[];
bool testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const override;
bool testImmPredicate_APInt(unsigned PredicateID, const APInt &Imm) const override;
bool testImmPredicate_APFloat(unsigned PredicateID, const APFloat &Imm) const override;
const int64_t *getMatchTable() const override;
bool testMIPredicate_MI(unsigned PredicateID, const MachineInstr &MI) const override;
#endif // ifdef GET_GLOBALISEL_TEMPORARIES_DECL
#ifdef GET_GLOBALISEL_TEMPORARIES_INIT
, State(0),
ISelInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers)
#endif // ifdef GET_GLOBALISEL_TEMPORARIES_INIT
#ifdef GET_GLOBALISEL_IMPL
// Bits for subtarget features that participate in instruction matching.
enum SubtargetFeatureBits : uint8_t {
Feature_HasMips2Bit = 7,
Feature_HasMips3Bit = 17,
Feature_HasMips4_32Bit = 27,
Feature_NotMips4_32Bit = 28,
Feature_HasMips4_32r2Bit = 18,
Feature_HasMips32Bit = 3,
Feature_HasMips32r2Bit = 6,
Feature_HasMips32r6Bit = 29,
Feature_NotMips32r6Bit = 4,
Feature_IsGP64bitBit = 22,
Feature_IsPTR64bitBit = 24,
Feature_HasMips64Bit = 25,
Feature_HasMips64r2Bit = 23,
Feature_HasMips64r6Bit = 30,
Feature_NotMips64r6Bit = 5,
Feature_InMips16ModeBit = 31,
Feature_NotInMips16ModeBit = 0,
Feature_HasCnMipsBit = 26,
Feature_NotCnMipsBit = 8,
Feature_IsSym32Bit = 38,
Feature_IsSym64Bit = 39,
Feature_IsN64Bit = 40,
Feature_RelocNotPICBit = 9,
Feature_RelocPICBit = 37,
Feature_NoNaNsFPMathBit = 21,
Feature_UseAbsBit = 14,
Feature_HasStdEncBit = 1,
Feature_NotDSPBit = 11,
Feature_InMicroMipsBit = 35,
Feature_NotInMicroMipsBit = 2,
Feature_IsLEBit = 42,
Feature_IsBEBit = 43,
Feature_IsNotNaClBit = 19,
Feature_HasEVABit = 36,
Feature_HasMSABit = 34,
Feature_HasMadd4Bit = 20,
Feature_UseIndirectJumpsHazardBit = 12,
Feature_NoIndirectJumpGuardsBit = 10,
Feature_AllowFPOpFusionBit = 41,
Feature_IsFP64bitBit = 16,
Feature_NotFP64bitBit = 15,
Feature_IsNotSoftFloatBit = 13,
Feature_HasDSPBit = 32,
Feature_HasDSPR2Bit = 33,
};
PredicateBitset MipsInstructionSelector::
computeAvailableModuleFeatures(const MipsSubtarget *Subtarget) const {
PredicateBitset Features;
if (Subtarget->hasMips2())
Features.set(Feature_HasMips2Bit);
if (Subtarget->hasMips3())
Features.set(Feature_HasMips3Bit);
if (Subtarget->hasMips4_32())
Features.set(Feature_HasMips4_32Bit);
if (!Subtarget->hasMips4_32())
Features.set(Feature_NotMips4_32Bit);
if (Subtarget->hasMips4_32r2())
Features.set(Feature_HasMips4_32r2Bit);
if (Subtarget->hasMips32())
Features.set(Feature_HasMips32Bit);
if (Subtarget->hasMips32r2())
Features.set(Feature_HasMips32r2Bit);
if (Subtarget->hasMips32r6())
Features.set(Feature_HasMips32r6Bit);
if (!Subtarget->hasMips32r6())
Features.set(Feature_NotMips32r6Bit);
if (Subtarget->isGP64bit())
Features.set(Feature_IsGP64bitBit);
if (Subtarget->isABI_N64())
Features.set(Feature_IsPTR64bitBit);
if (Subtarget->hasMips64())
Features.set(Feature_HasMips64Bit);
if (Subtarget->hasMips64r2())
Features.set(Feature_HasMips64r2Bit);
if (Subtarget->hasMips64r6())
Features.set(Feature_HasMips64r6Bit);
if (!Subtarget->hasMips64r6())
Features.set(Feature_NotMips64r6Bit);
if (Subtarget->inMips16Mode())
Features.set(Feature_InMips16ModeBit);
if (!Subtarget->inMips16Mode())
Features.set(Feature_NotInMips16ModeBit);
if (Subtarget->hasCnMips())
Features.set(Feature_HasCnMipsBit);
if (!Subtarget->hasCnMips())
Features.set(Feature_NotCnMipsBit);
if (Subtarget->hasSym32())
Features.set(Feature_IsSym32Bit);
if (!Subtarget->hasSym32())
Features.set(Feature_IsSym64Bit);
if (Subtarget->isABI_N64())
Features.set(Feature_IsN64Bit);
if (!TM.isPositionIndependent())
Features.set(Feature_RelocNotPICBit);
if (TM.isPositionIndependent())
Features.set(Feature_RelocPICBit);
if (TM.Options.NoNaNsFPMath)
Features.set(Feature_NoNaNsFPMathBit);
if (Subtarget->inAbs2008Mode() ||TM.Options.NoNaNsFPMath)
Features.set(Feature_UseAbsBit);
if (Subtarget->hasStandardEncoding())
Features.set(Feature_HasStdEncBit);
if (!Subtarget->hasDSP())
Features.set(Feature_NotDSPBit);
if (Subtarget->inMicroMipsMode())
Features.set(Feature_InMicroMipsBit);
if (!Subtarget->inMicroMipsMode())
Features.set(Feature_NotInMicroMipsBit);
if (Subtarget->isLittle())
Features.set(Feature_IsLEBit);
if (!Subtarget->isLittle())
Features.set(Feature_IsBEBit);
if (!Subtarget->isTargetNaCl())
Features.set(Feature_IsNotNaClBit);
if (Subtarget->hasEVA())
Features.set(Feature_HasEVABit);
if (Subtarget->hasMSA())
Features.set(Feature_HasMSABit);
if (!Subtarget->disableMadd4())
Features.set(Feature_HasMadd4Bit);
if (Subtarget->useIndirectJumpsHazard())
Features.set(Feature_UseIndirectJumpsHazardBit);
if (!Subtarget->useIndirectJumpsHazard())
Features.set(Feature_NoIndirectJumpGuardsBit);
if (TM.Options.AllowFPOpFusion == FPOpFusion::Fast)
Features.set(Feature_AllowFPOpFusionBit);
if (Subtarget->isFP64bit())
Features.set(Feature_IsFP64bitBit);
if (!Subtarget->isFP64bit())
Features.set(Feature_NotFP64bitBit);
if (!Subtarget->useSoftFloat())
Features.set(Feature_IsNotSoftFloatBit);
if (Subtarget->hasDSP())
Features.set(Feature_HasDSPBit);
if (Subtarget->hasDSPR2())
Features.set(Feature_HasDSPR2Bit);
return Features;
}
PredicateBitset MipsInstructionSelector::
computeAvailableFunctionFeatures(const MipsSubtarget *Subtarget, const MachineFunction *MF) const {
PredicateBitset Features;
return Features;
}
// LLT Objects.
enum {
GILLT_s16,
GILLT_s32,
GILLT_s64,
GILLT_v2s16,
GILLT_v2s64,
GILLT_v4s8,
GILLT_v4s32,
GILLT_v8s16,
GILLT_v16s8,
};
const static size_t NumTypeObjects = 9;
const static LLT TypeObjects[] = {
LLT::scalar(16),
LLT::scalar(32),
LLT::scalar(64),
LLT::vector(2, 16),
LLT::vector(2, 64),
LLT::vector(4, 8),
LLT::vector(4, 32),
LLT::vector(8, 16),
LLT::vector(16, 8),
};
// Feature bitsets.
enum {
GIFBS_Invalid,
GIFBS_HasCnMips,
GIFBS_HasDSP,
GIFBS_HasDSPR2,
GIFBS_HasMSA,
GIFBS_InMicroMips,
GIFBS_InMips16Mode,
GIFBS_IsFP64bit,
GIFBS_NotFP64bit,
GIFBS_HasDSP_InMicroMips,
GIFBS_HasDSP_NotInMicroMips,
GIFBS_HasDSPR2_InMicroMips,
GIFBS_HasMSA_HasStdEnc,
GIFBS_HasMSA_IsBE,
GIFBS_HasMSA_IsLE,
GIFBS_HasMips32r6_HasStdEnc,
GIFBS_HasMips32r6_InMicroMips,
GIFBS_HasMips64r2_HasStdEnc,
GIFBS_HasMips64r6_HasStdEnc,
GIFBS_HasStdEnc_IsNotSoftFloat,
GIFBS_HasStdEnc_NotInMicroMips,
GIFBS_HasStdEnc_NotMips4_32,
GIFBS_InMicroMips_IsFP64bit,
GIFBS_InMicroMips_IsNotSoftFloat,
GIFBS_InMicroMips_NotFP64bit,
GIFBS_InMicroMips_NotMips32r6,
GIFBS_IsGP64bit_NotInMips16Mode,
GIFBS_AllowFPOpFusion_HasMSA_HasStdEnc,
GIFBS_HasMSA_HasMips64_HasStdEnc,
GIFBS_HasMips3_HasStdEnc_IsGP64bit,
GIFBS_HasMips3_HasStdEnc_NotInMicroMips,
GIFBS_HasMips32r2_HasStdEnc_NotInMicroMips,
GIFBS_HasMips32r6_HasStdEnc_NotInMicroMips,
GIFBS_HasMips32r6_InMicroMips_IsNotSoftFloat,
GIFBS_HasMips64r6_HasStdEnc_NotInMicroMips,
GIFBS_HasStdEnc_IsFP64bit_NotInMicroMips,
GIFBS_HasStdEnc_IsFP64bit_NotMips4_32,
GIFBS_HasStdEnc_IsNotSoftFloat_NotInMicroMips,
GIFBS_HasStdEnc_NotFP64bit_NotInMicroMips,
GIFBS_HasStdEnc_NotFP64bit_NotMips4_32,
GIFBS_HasStdEnc_NotInMicroMips_RelocNotPIC,
GIFBS_InMicroMips_IsFP64bit_IsNotSoftFloat,
GIFBS_InMicroMips_IsNotSoftFloat_NotFP64bit,
GIFBS_InMicroMips_IsNotSoftFloat_UseAbs,
GIFBS_InMicroMips_NotFP64bit_NotMips32r6,
GIFBS_InMicroMips_NotMips32r6_RelocNotPIC,
GIFBS_InMicroMips_NotMips32r6_RelocPIC,
GIFBS_HasMips2_HasStdEnc_IsNotSoftFloat_NotInMicroMips,
GIFBS_HasMips3_HasStdEnc_IsGP64bit_NotInMicroMips,
GIFBS_HasMips3_HasStdEnc_IsNotSoftFloat_NotInMicroMips,
GIFBS_HasMips32r6_HasStdEnc_IsNotSoftFloat_NotInMicroMips,
GIFBS_HasMips4_32_HasStdEnc_NotMips32r6_NotMips64r6,
GIFBS_HasMips64r2_HasStdEnc_IsGP64bit_NotInMicroMips,
GIFBS_HasStdEnc_IsFP64bit_IsNotSoftFloat_NotInMicroMips,
GIFBS_HasStdEnc_IsNotSoftFloat_NotFP64bit_NotInMicroMips,
GIFBS_HasStdEnc_IsNotSoftFloat_NotInMicroMips_UseAbs,
GIFBS_HasMips2_HasStdEnc_IsFP64bit_IsNotSoftFloat_NotInMicroMips,
GIFBS_HasMips2_HasStdEnc_IsNotSoftFloat_NotFP64bit_NotInMicroMips,
GIFBS_HasMips32_HasStdEnc_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMips4_32_HasStdEnc_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMips64_HasStdEnc_IsGP64bit_NotInMicroMips_NotMips64r6,
GIFBS_HasStdEnc_IsFP64bit_IsNotSoftFloat_NotInMicroMips_UseAbs,
GIFBS_HasStdEnc_IsNotSoftFloat_NotFP64bit_NotInMicroMips_UseAbs,
GIFBS_HasMadd4_InMicroMips_InMicroMips_NoNaNsFPMath_NotMips32r6_NotMips32r6,
GIFBS_HasMips4_32_HasStdEnc_IsFP64bit_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMips4_32_HasStdEnc_IsGP64bit_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMips4_32_HasStdEnc_NotFP64bit_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMadd4_HasMips4_32r2_HasStdEnc_IsNotSoftFloat_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMadd4_HasMips4_32r2_HasStdEnc_NoNaNsFPMath_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMadd4_InMicroMips_InMicroMips_NoNaNsFPMath_NotFP64bit_NotMips32r6_NotMips32r6,
GIFBS_HasMadd4_HasMips4_32r2_HasStdEnc_IsFP64bit_IsNotSoftFloat_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMadd4_HasMips4_32r2_HasStdEnc_IsFP64bit_NoNaNsFPMath_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMadd4_HasMips4_32r2_HasStdEnc_IsNotSoftFloat_NotFP64bit_NotInMicroMips_NotMips32r6_NotMips64r6,
GIFBS_HasMadd4_HasMips4_32r2_HasStdEnc_NoNaNsFPMath_NotFP64bit_NotInMicroMips_NotMips32r6_NotMips64r6,
};
const static PredicateBitset FeatureBitsets[] {
{}, // GIFBS_Invalid
{Feature_HasCnMipsBit, },
{Feature_HasDSPBit, },
{Feature_HasDSPR2Bit, },
{Feature_HasMSABit, },
{Feature_InMicroMipsBit, },
{Feature_InMips16ModeBit, },
{Feature_IsFP64bitBit, },
{Feature_NotFP64bitBit, },
{Feature_HasDSPBit, Feature_InMicroMipsBit, },
{Feature_HasDSPBit, Feature_NotInMicroMipsBit, },
{Feature_HasDSPR2Bit, Feature_InMicroMipsBit, },
{Feature_HasMSABit, Feature_HasStdEncBit, },
{Feature_HasMSABit, Feature_IsBEBit, },
{Feature_HasMSABit, Feature_IsLEBit, },
{Feature_HasMips32r6Bit, Feature_HasStdEncBit, },
{Feature_HasMips32r6Bit, Feature_InMicroMipsBit, },
{Feature_HasMips64r2Bit, Feature_HasStdEncBit, },
{Feature_HasMips64r6Bit, Feature_HasStdEncBit, },
{Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, },
{Feature_HasStdEncBit, Feature_NotInMicroMipsBit, },
{Feature_HasStdEncBit, Feature_NotMips4_32Bit, },
{Feature_InMicroMipsBit, Feature_IsFP64bitBit, },
{Feature_InMicroMipsBit, Feature_IsNotSoftFloatBit, },
{Feature_InMicroMipsBit, Feature_NotFP64bitBit, },
{Feature_InMicroMipsBit, Feature_NotMips32r6Bit, },
{Feature_IsGP64bitBit, Feature_NotInMips16ModeBit, },
{Feature_AllowFPOpFusionBit, Feature_HasMSABit, Feature_HasStdEncBit, },
{Feature_HasMSABit, Feature_HasMips64Bit, Feature_HasStdEncBit, },
{Feature_HasMips3Bit, Feature_HasStdEncBit, Feature_IsGP64bitBit, },
{Feature_HasMips3Bit, Feature_HasStdEncBit, Feature_NotInMicroMipsBit, },
{Feature_HasMips32r2Bit, Feature_HasStdEncBit, Feature_NotInMicroMipsBit, },
{Feature_HasMips32r6Bit, Feature_HasStdEncBit, Feature_NotInMicroMipsBit, },
{Feature_HasMips32r6Bit, Feature_InMicroMipsBit, Feature_IsNotSoftFloatBit, },
{Feature_HasMips64r6Bit, Feature_HasStdEncBit, Feature_NotInMicroMipsBit, },
{Feature_HasStdEncBit, Feature_IsFP64bitBit, Feature_NotInMicroMipsBit, },
{Feature_HasStdEncBit, Feature_IsFP64bitBit, Feature_NotMips4_32Bit, },
{Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, },
{Feature_HasStdEncBit, Feature_NotFP64bitBit, Feature_NotInMicroMipsBit, },
{Feature_HasStdEncBit, Feature_NotFP64bitBit, Feature_NotMips4_32Bit, },
{Feature_HasStdEncBit, Feature_NotInMicroMipsBit, Feature_RelocNotPICBit, },
{Feature_InMicroMipsBit, Feature_IsFP64bitBit, Feature_IsNotSoftFloatBit, },
{Feature_InMicroMipsBit, Feature_IsNotSoftFloatBit, Feature_NotFP64bitBit, },
{Feature_InMicroMipsBit, Feature_IsNotSoftFloatBit, Feature_UseAbsBit, },
{Feature_InMicroMipsBit, Feature_NotFP64bitBit, Feature_NotMips32r6Bit, },
{Feature_InMicroMipsBit, Feature_NotMips32r6Bit, Feature_RelocNotPICBit, },
{Feature_InMicroMipsBit, Feature_NotMips32r6Bit, Feature_RelocPICBit, },
{Feature_HasMips2Bit, Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, },
{Feature_HasMips3Bit, Feature_HasStdEncBit, Feature_IsGP64bitBit, Feature_NotInMicroMipsBit, },
{Feature_HasMips3Bit, Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, },
{Feature_HasMips32r6Bit, Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, },
{Feature_HasMips4_32Bit, Feature_HasStdEncBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMips64r2Bit, Feature_HasStdEncBit, Feature_IsGP64bitBit, Feature_NotInMicroMipsBit, },
{Feature_HasStdEncBit, Feature_IsFP64bitBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, },
{Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotFP64bitBit, Feature_NotInMicroMipsBit, },
{Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, Feature_UseAbsBit, },
{Feature_HasMips2Bit, Feature_HasStdEncBit, Feature_IsFP64bitBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, },
{Feature_HasMips2Bit, Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotFP64bitBit, Feature_NotInMicroMipsBit, },
{Feature_HasMips32Bit, Feature_HasStdEncBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMips4_32Bit, Feature_HasStdEncBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMips64Bit, Feature_HasStdEncBit, Feature_IsGP64bitBit, Feature_NotInMicroMipsBit, Feature_NotMips64r6Bit, },
{Feature_HasStdEncBit, Feature_IsFP64bitBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, Feature_UseAbsBit, },
{Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotFP64bitBit, Feature_NotInMicroMipsBit, Feature_UseAbsBit, },
{Feature_HasMadd4Bit, Feature_InMicroMipsBit, Feature_InMicroMipsBit, Feature_NoNaNsFPMathBit, Feature_NotMips32r6Bit, Feature_NotMips32r6Bit, },
{Feature_HasMips4_32Bit, Feature_HasStdEncBit, Feature_IsFP64bitBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMips4_32Bit, Feature_HasStdEncBit, Feature_IsGP64bitBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMips4_32Bit, Feature_HasStdEncBit, Feature_NotFP64bitBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMadd4Bit, Feature_HasMips4_32r2Bit, Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMadd4Bit, Feature_HasMips4_32r2Bit, Feature_HasStdEncBit, Feature_NoNaNsFPMathBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMadd4Bit, Feature_InMicroMipsBit, Feature_InMicroMipsBit, Feature_NoNaNsFPMathBit, Feature_NotFP64bitBit, Feature_NotMips32r6Bit, Feature_NotMips32r6Bit, },
{Feature_HasMadd4Bit, Feature_HasMips4_32r2Bit, Feature_HasStdEncBit, Feature_IsFP64bitBit, Feature_IsNotSoftFloatBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMadd4Bit, Feature_HasMips4_32r2Bit, Feature_HasStdEncBit, Feature_IsFP64bitBit, Feature_NoNaNsFPMathBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMadd4Bit, Feature_HasMips4_32r2Bit, Feature_HasStdEncBit, Feature_IsNotSoftFloatBit, Feature_NotFP64bitBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
{Feature_HasMadd4Bit, Feature_HasMips4_32r2Bit, Feature_HasStdEncBit, Feature_NoNaNsFPMathBit, Feature_NotFP64bitBit, Feature_NotInMicroMipsBit, Feature_NotMips32r6Bit, Feature_NotMips64r6Bit, },
};
// ComplexPattern predicates.
enum {
GICP_Invalid,
};
// See constructor for table contents
// PatFrag predicates.
enum {
GIPFP_I64_Predicate_immLi16 = GIPFP_I64_Invalid + 1,
GIPFP_I64_Predicate_immSExt10,
GIPFP_I64_Predicate_immSExt6,
GIPFP_I64_Predicate_immSExtAddiur2,
GIPFP_I64_Predicate_immSExtAddius5,
GIPFP_I64_Predicate_immZExt1,
GIPFP_I64_Predicate_immZExt10,
GIPFP_I64_Predicate_immZExt1Ptr,
GIPFP_I64_Predicate_immZExt2,
GIPFP_I64_Predicate_immZExt2Lsa,
GIPFP_I64_Predicate_immZExt2Ptr,
GIPFP_I64_Predicate_immZExt2Shift,
GIPFP_I64_Predicate_immZExt3,
GIPFP_I64_Predicate_immZExt3Ptr,
GIPFP_I64_Predicate_immZExt4,
GIPFP_I64_Predicate_immZExt4Ptr,
GIPFP_I64_Predicate_immZExt5,
GIPFP_I64_Predicate_immZExt5_64,
GIPFP_I64_Predicate_immZExt6,
GIPFP_I64_Predicate_immZExt8,
GIPFP_I64_Predicate_immZExtAndi16,
GIPFP_I64_Predicate_immi32Cst15,
GIPFP_I64_Predicate_immi32Cst31,
GIPFP_I64_Predicate_immi32Cst7,
GIPFP_I64_Predicate_timmSExt6,
GIPFP_I64_Predicate_timmZExt1,
GIPFP_I64_Predicate_timmZExt10,
GIPFP_I64_Predicate_timmZExt1Ptr,
GIPFP_I64_Predicate_timmZExt2,
GIPFP_I64_Predicate_timmZExt2Ptr,
GIPFP_I64_Predicate_timmZExt3,
GIPFP_I64_Predicate_timmZExt3Ptr,
GIPFP_I64_Predicate_timmZExt4,
GIPFP_I64_Predicate_timmZExt4Ptr,
GIPFP_I64_Predicate_timmZExt5,
GIPFP_I64_Predicate_timmZExt6,
GIPFP_I64_Predicate_timmZExt8,
};
bool MipsInstructionSelector::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const {
switch (PredicateID) {
case GIPFP_I64_Predicate_immLi16: {
return Imm >= -1 && Imm <= 126;
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immSExt10: {
return isInt<10>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immSExt6: {
return isInt<6>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immSExtAddiur2: {
return Imm == 1 || Imm == -1 ||
((Imm % 4 == 0) &&
Imm < 28 && Imm > 0);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immSExtAddius5: {
return Imm >= -8 && Imm <= 7;
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt1: {
return isUInt<1>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt10: {
return isUInt<10>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt1Ptr: {
return isUInt<1>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt2: {
return isUInt<2>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt2Lsa: {
return isUInt<2>(Imm - 1);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt2Ptr: {
return isUInt<2>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt2Shift: {
return Imm >= 1 && Imm <= 8;
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt3: {
return isUInt<3>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt3Ptr: {
return isUInt<3>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt4: {
return isUInt<4>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt4Ptr: {
return isUInt<4>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt5: {
return Imm == (Imm & 0x1f);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt5_64: {
return Imm == (Imm & 0x1f);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt6: {
return Imm == (Imm & 0x3f);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExt8: {
return isUInt<8>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immZExtAndi16: {
return (Imm == 128 || (Imm >= 1 && Imm <= 4) || Imm == 7 || Imm == 8 ||
Imm == 15 || Imm == 16 || Imm == 31 || Imm == 32 || Imm == 63 ||
Imm == 64 || Imm == 255 || Imm == 32768 || Imm == 65535 );
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immi32Cst15: {
return isUInt<32>(Imm) && Imm == 15;
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immi32Cst31: {
return isUInt<32>(Imm) && Imm == 31;
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_immi32Cst7: {
return isUInt<32>(Imm) && Imm == 7;
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmSExt6: {
return isInt<6>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt1: {
return isUInt<1>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt10: {
return isUInt<10>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt1Ptr: {
return isUInt<1>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt2: {
return isUInt<2>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt2Ptr: {
return isUInt<2>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt3: {
return isUInt<3>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt3Ptr: {
return isUInt<3>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt4: {
return isUInt<4>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt4Ptr: {
return isUInt<4>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt5: {
return Imm == (Imm & 0x1f);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt6: {
return Imm == (Imm & 0x3f);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
case GIPFP_I64_Predicate_timmZExt8: {
return isUInt<8>(Imm);
llvm_unreachable("ImmediateCode should have returned");
return false;
}
}
llvm_unreachable("Unknown predicate");
return false;
}
bool MipsInstructionSelector::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const {
llvm_unreachable("Unknown predicate");
return false;
}
bool MipsInstructionSelector::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const {
llvm_unreachable("Unknown predicate");
return false;
}
bool MipsInstructionSelector::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI) const {
const MachineFunction &MF = *MI.getParent()->getParent();
const MachineRegisterInfo &MRI = MF.getRegInfo();
(void)MRI;
llvm_unreachable("Unknown predicate");
return false;
}
MipsInstructionSelector::ComplexMatcherMemFn
MipsInstructionSelector::ComplexPredicateFns[] = {
nullptr, // GICP_Invalid
};
// Custom renderers.
enum {
GICR_Invalid,
};
MipsInstructionSelector::CustomRendererFn
MipsInstructionSelector::CustomRenderers[] = {
nullptr, // GICP_Invalid
};
bool MipsInstructionSelector::selectImpl(MachineInstr &I, CodeGenCoverage &CoverageInfo) const {
MachineFunction &MF = *I.getParent()->getParent();
MachineRegisterInfo &MRI = MF.getRegInfo();
// FIXME: This should be computed on a per-function basis rather than per-insn.
AvailableFunctionFeatures = computeAvailableFunctionFeatures(&STI, &MF);
const PredicateBitset AvailableFeatures = getAvailableFeatures();
NewMIVector OutMIs;
State.MIs.clear();
State.MIs.push_back(&I);
if (executeMatchTable(*this, OutMIs, State, ISelInfo, getMatchTable(), TII, MRI, TRI, RBI, AvailableFeatures, CoverageInfo)) {
return true;
}
return false;
}
const int64_t *MipsInstructionSelector::getMatchTable() const {
constexpr static int64_t MatchTable0[] = {
GIM_SwitchOpcode, /*MI*/0, /*[*/35, 169, /*)*//*default:*//*Label 54*/ 55651,
/*TargetOpcode::G_ADD*//*Label 0*/ 139,
/*TargetOpcode::G_SUB*//*Label 1*/ 1316,
/*TargetOpcode::G_MUL*//*Label 2*/ 1928,
/*TargetOpcode::G_SDIV*//*Label 3*/ 2304,
/*TargetOpcode::G_UDIV*//*Label 4*/ 2525,
/*TargetOpcode::G_SREM*//*Label 5*/ 2746,
/*TargetOpcode::G_UREM*//*Label 6*/ 2967,
/*TargetOpcode::G_AND*//*Label 7*/ 3188,
/*TargetOpcode::G_OR*//*Label 8*/ 3632,
/*TargetOpcode::G_XOR*//*Label 9*/ 3934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*TargetOpcode::G_BITCAST*//*Label 10*/ 4731, 0, 0,
/*TargetOpcode::G_LOAD*//*Label 11*/ 8384,
/*TargetOpcode::G_SEXTLOAD*//*Label 12*/ 8450,
/*TargetOpcode::G_ZEXTLOAD*//*Label 13*/ 8516, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*TargetOpcode::G_INTRINSIC*//*Label 14*/ 8582,
/*TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS*//*Label 15*/ 24745,
/*TargetOpcode::G_ANYEXT*//*Label 16*/ 29721,
/*TargetOpcode::G_TRUNC*//*Label 17*/ 29787,
/*TargetOpcode::G_CONSTANT*//*Label 18*/ 29850, 0, 0, 0,
/*TargetOpcode::G_SEXT*//*Label 19*/ 29910, 0,
/*TargetOpcode::G_ZEXT*//*Label 20*/ 31168,
/*TargetOpcode::G_SHL*//*Label 21*/ 31362,
/*TargetOpcode::G_LSHR*//*Label 22*/ 31892,
/*TargetOpcode::G_ASHR*//*Label 23*/ 32422,
/*TargetOpcode::G_ICMP*//*Label 24*/ 32909,
/*TargetOpcode::G_FCMP*//*Label 25*/ 35413,
/*TargetOpcode::G_SELECT*//*Label 26*/ 37133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*TargetOpcode::G_UMULH*//*Label 27*/ 49413,
/*TargetOpcode::G_SMULH*//*Label 28*/ 49500,
/*TargetOpcode::G_FADD*//*Label 29*/ 49587,
/*TargetOpcode::G_FSUB*//*Label 30*/ 50466,
/*TargetOpcode::G_FMUL*//*Label 31*/ 51042,
/*TargetOpcode::G_FMA*//*Label 32*/ 51479, 0,
/*TargetOpcode::G_FDIV*//*Label 33*/ 51569, 0, 0, 0,
/*TargetOpcode::G_FEXP2*//*Label 34*/ 51820, 0,
/*TargetOpcode::G_FLOG2*//*Label 35*/ 51878, 0,
/*TargetOpcode::G_FNEG*//*Label 36*/ 51936,
/*TargetOpcode::G_FPEXT*//*Label 37*/ 53232,
/*TargetOpcode::G_FPTRUNC*//*Label 38*/ 53381,
/*TargetOpcod |