forked from OSchip/llvm-project
[AMDGPU] Added MI bit IsDOT
NFC, needed for future commit. Differential Revision: https://reviews.llvm.org/D67669 llvm-svn: 372151
This commit is contained in:
parent
8c2d2f6ee3
commit
1fb584f7a2
|
@ -99,7 +99,10 @@ enum : uint64_t {
|
|||
FPAtomic = UINT64_C(1) << 53,
|
||||
|
||||
// Is a MFMA instruction.
|
||||
IsMAI = UINT64_C(1) << 54
|
||||
IsMAI = UINT64_C(1) << 54,
|
||||
|
||||
// Is a DOT instruction.
|
||||
IsDOT = UINT64_C(1) << 55
|
||||
};
|
||||
|
||||
// v_cmp_class_* etc. use a 10-bit mask for what operation is checked.
|
||||
|
|
|
@ -124,6 +124,9 @@ class InstSI <dag outs, dag ins, string asm = "",
|
|||
// This bit indicates that this is one of MFMA instructions.
|
||||
field bit IsMAI = 0;
|
||||
|
||||
// This bit indicates that this is one of DOT instructions.
|
||||
field bit IsDOT = 0;
|
||||
|
||||
// These need to be kept in sync with the enum in SIInstrFlags.
|
||||
let TSFlags{0} = SALU;
|
||||
let TSFlags{1} = VALU;
|
||||
|
@ -189,6 +192,8 @@ class InstSI <dag outs, dag ins, string asm = "",
|
|||
|
||||
let TSFlags{54} = IsMAI;
|
||||
|
||||
let TSFlags{55} = IsDOT;
|
||||
|
||||
let SchedRW = [Write32Bit];
|
||||
|
||||
field bits<1> DisableSIDecoder = 0;
|
||||
|
|
|
@ -578,6 +578,14 @@ public:
|
|||
return get(Opcode).TSFlags & SIInstrFlags::IsMAI;
|
||||
}
|
||||
|
||||
static bool isDOT(const MachineInstr &MI) {
|
||||
return MI.getDesc().TSFlags & SIInstrFlags::IsDOT;
|
||||
}
|
||||
|
||||
bool isDOT(uint16_t Opcode) const {
|
||||
return get(Opcode).TSFlags & SIInstrFlags::IsDOT;
|
||||
}
|
||||
|
||||
static bool isScalarUnit(const MachineInstr &MI) {
|
||||
return MI.getDesc().TSFlags & (SIInstrFlags::SALU | SIInstrFlags::SMRD);
|
||||
}
|
||||
|
|
|
@ -2139,6 +2139,7 @@ class VOPProfile <list<ValueType> _ArgVT, bit _EnableF32SrcMods = 0,
|
|||
field int NeedPatGen = PatGenMode.NoPattern;
|
||||
|
||||
field bit IsMAI = 0;
|
||||
field bit IsDOT = 0;
|
||||
|
||||
field Operand Src0PackedMod = !if(HasSrc0FloatMods, PackedF16InputMods, PackedI16InputMods);
|
||||
field Operand Src1PackedMod = !if(HasSrc1FloatMods, PackedF16InputMods, PackedI16InputMods);
|
||||
|
|
|
@ -653,7 +653,8 @@ defm V_FMAC_F32 : VOP2Inst <"v_fmac_f32", VOP_MAC_F32>;
|
|||
let Constraints = "$vdst = $src2",
|
||||
DisableEncoding="$src2",
|
||||
isConvertibleToThreeAddress = 1,
|
||||
isCommutable = 1 in {
|
||||
isCommutable = 1,
|
||||
IsDOT = 1 in {
|
||||
let SubtargetPredicate = HasDot5Insts in
|
||||
defm V_DOT2C_F32_F16 : VOP2Inst_e32<"v_dot2c_f32_f16", VOP_DOT_ACC_F32_V2F16>;
|
||||
let SubtargetPredicate = HasDot6Insts in
|
||||
|
|
|
@ -261,6 +261,7 @@ class SDot2Pat<Instruction Inst> : GCNPat <
|
|||
let SubtargetPredicate = !cast<VOP_Pseudo>(Inst).SubtargetPredicate;
|
||||
}
|
||||
|
||||
let IsDOT = 1 in {
|
||||
let SubtargetPredicate = HasDot2Insts in {
|
||||
|
||||
def V_DOT2_F32_F16 : VOP3PInst<"v_dot2_f32_f16", VOP3_Profile<VOP_F32_V2F16_V2F16_F32>>;
|
||||
|
@ -277,6 +278,7 @@ def V_DOT4_I32_I8 : VOP3PInst<"v_dot4_i32_i8", VOP3_Profile<VOP_I32_I32_I32_I32
|
|||
def V_DOT8_I32_I4 : VOP3PInst<"v_dot8_i32_i4", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_PACKED>>;
|
||||
|
||||
} // End SubtargetPredicate = HasDot1Insts
|
||||
} // End let IsDOT = 1
|
||||
|
||||
multiclass DotPats<SDPatternOperator dot_op,
|
||||
VOP3PInst dot_inst> {
|
||||
|
|
Loading…
Reference in New Issue