diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -2194,9 +2194,9 @@ case CASE_VFMA_OPCODE_LMULS_MF4(OP, TYPE) #define CASE_VFMA_SPLATS(OP) \ - CASE_VFMA_OPCODE_LMULS_MF4(OP, VF16): \ - case CASE_VFMA_OPCODE_LMULS_MF2(OP, VF32): \ - case CASE_VFMA_OPCODE_LMULS_M1(OP, VF64) + CASE_VFMA_OPCODE_LMULS_MF4(OP, VFPR16): \ + case CASE_VFMA_OPCODE_LMULS_MF2(OP, VFPR32): \ + case CASE_VFMA_OPCODE_LMULS_M1(OP, VFPR64) // clang-format on bool RISCVInstrInfo::findCommutedOpIndices(const MachineInstr &MI, @@ -2357,9 +2357,9 @@ CASE_VFMA_CHANGE_OPCODE_LMULS_MF4(OLDOP, NEWOP, TYPE) #define CASE_VFMA_CHANGE_OPCODE_SPLATS(OLDOP, NEWOP) \ - CASE_VFMA_CHANGE_OPCODE_LMULS_MF4(OLDOP, NEWOP, VF16) \ - CASE_VFMA_CHANGE_OPCODE_LMULS_MF2(OLDOP, NEWOP, VF32) \ - CASE_VFMA_CHANGE_OPCODE_LMULS_M1(OLDOP, NEWOP, VF64) + CASE_VFMA_CHANGE_OPCODE_LMULS_MF4(OLDOP, NEWOP, VFPR16) \ + CASE_VFMA_CHANGE_OPCODE_LMULS_MF2(OLDOP, NEWOP, VFPR32) \ + CASE_VFMA_CHANGE_OPCODE_LMULS_M1(OLDOP, NEWOP, VFPR64) MachineInstr *RISCVInstrInfo::commuteInstructionImpl(MachineInstr &MI, bool NewMI, diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td @@ -115,16 +115,9 @@ ["_E32", ""], ["_E16", ""], ["_E8", ""], - ["_F64", "_F"], - ["_F32", "_F"], - ["_F16", "_F"], - ["_VF64", "_VF"], - ["_VF32", "_VF"], - ["_VF16", "_VF"], - ["_VBF16", "_VF"], - ["_WF64", "_WF"], - ["_WF32", "_WF"], - ["_WF16", "_WF"], + ["FPR64", "F"], + ["FPR32", "F"], + ["FPR16", "F"], ["_TU", ""], ["_TIED", ""], ["_MASK", ""], @@ -205,15 +198,7 @@ class FPR_Info { RegisterClass fprclass = !cast("FPR" # sew); - string FX = "F" # sew; - int SEW = sew; - list MxList = MxSet.m; - list MxListFW = !if(!eq(sew, 64), [], !listremove(MxList, [V_M8])); -} - -class BFPR_Info { - RegisterClass fprclass = !cast("FPR" # sew); - string FX = "BF" # sew; + string FX = "FPR" # sew; int SEW = sew; list MxList = MxSet.m; list MxListFW = !if(!eq(sew, 64), [], !listremove(MxList, [V_M8])); @@ -223,7 +208,8 @@ def SCALAR_F32 : FPR_Info<32>; def SCALAR_F64 : FPR_Info<64>; -def SCALAR_BF16 : BFPR_Info<16>; +// BF16 uses the same register class as F16. +def SCALAR_BF16 : FPR_Info<16>; defvar FPList = [SCALAR_F16, SCALAR_F32, SCALAR_F64]; @@ -286,10 +272,10 @@ OutPatFrag AVL = VLMax; string ScalarSuffix = !cond(!eq(Scal, XLenVT) : "X", - !eq(Scal, f16) : "F16", - !eq(Scal, bf16) : "BF16", - !eq(Scal, f32) : "F32", - !eq(Scal, f64) : "F64"); + !eq(Scal, f16) : "FPR16", + !eq(Scal, bf16) : "FPR16", + !eq(Scal, f32) : "FPR32", + !eq(Scal, f64) : "FPR64"); } class GroupVTypeInfo; } -multiclass VPseudoTernaryW_VF_BF_RM { - defvar constraint = "@earlyclobber $rd"; - defm "_V" # f.FX : VPseudoTernaryWithPolicyRoundingMode; -} - multiclass VPseudoVSLDVWithPolicy("ReadVFWMulAddV_" # mx); defvar ReadVFWMulAddF_MX = !cast("ReadVFWMulAddF_" # mx); - defm "" : VPseudoTernaryW_VF_BF_RM, + defm "" : VPseudoTernaryW_VF_RM, Sched<[WriteVFWMulAddF_MX, ReadVFWMulAddV_MX, ReadVFWMulAddF_MX, ReadVFWMulAddV_MX, ReadVMask]>; }