diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td @@ -232,15 +232,17 @@ } // op vd, vs2, rs1, vm (Float) -class VALUVF funct6, RISCVVFormat opv, string opcodestr> +class VALUVF funct6, RISCVVFormat opv, string opcodestr, + RegisterClass ScalarOp = FPR32> : RVInstVX; // op vd, rs1, vs2, vm (Float) (with mask, reverse the order of rs1 and vs2) -class VALUrVF funct6, RISCVVFormat opv, string opcodestr> +class VALUrVF funct6, RISCVVFormat opv, string opcodestr, + RegisterClass ScalarOp = FPR32> : RVInstVX; // op vd, vs2, vm (use vs1 as instruction encoding) @@ -338,15 +340,24 @@ multiclass VALU_FV_V_F funct6, string vw = "v"> { def V : VALUVV; def F : VALUVF; + let isCodeGenOnly = 1 in { + def D : VALUVF; + } } multiclass VALU_FV_F funct6, string vw = "v"> { def F : VALUVF; + let isCodeGenOnly = 1 in { + def D : VALUVF; + } } multiclass VALUr_FV_V_F funct6, string vw = "v"> { def V : VALUrVV; def F : VALUrVF; + let isCodeGenOnly = 1 in { + def D : VALUrVF; + } } multiclass VALU_FV_V funct6> { @@ -716,6 +727,13 @@ "vfmerge.vfm", "$vd, $vs2, $rs1, v0"> { let vm = 0; } +let isCodeGenOnly = 1 in { +def VFMERGE_VDM : RVInstVX<0b010111, OPFVF, (outs VRegOp:$vd), + (ins VRegOp:$vs2, FPR64:$rs1, VMV0:$v0), + "vfmerge.vfm", "$vd, $vs2, $rs1, v0"> { + let vm = 0; +} +} // Vector Floating-Point Move Instruction def VFMV_V_F : RVInstVX<0b010111, OPFVF, (outs VRegOp:$vd), @@ -723,6 +741,13 @@ let vs2 = 0; let vm = 1; } +let isCodeGenOnly = 1 in { +def VFMV_V_D : RVInstVX<0b010111, OPFVF, (outs VRegOp:$vd), + (ins FPR64:$rs1), "vfmv.v.f", "$vd, $rs1"> { + let vs2 = 0; + let vm = 1; +} +} } // hasSideEffects = 0, mayLoad = 0, mayStore = 0 // Single-Width Floating-Point/Integer Type-Convert Instructions @@ -860,7 +885,12 @@ (ins VRegOp:$vs2), "vfmv.f.s", "$vd, $vs2">; def VFMV_S_F : RVInstV2<0b010000, 0b00000, OPFVF, (outs VRegOp:$vd), (ins FPR32:$rs1), "vfmv.s.f", "$vd, $rs1">; - +let isCodeGenOnly = 1 in { +def VFMV_D_S : RVInstV<0b010000, 0b00000, OPFVV, (outs FPR64:$vd), + (ins VRegOp:$vs2), "vfmv.f.s", "$vd, $vs2">; +def VFMV_S_D : RVInstV2<0b010000, 0b00000, OPFVF, (outs VRegOp:$vd), + (ins FPR64:$rs1), "vfmv.s.f", "$vd, $rs1">; +} } // hasSideEffects = 0, mayLoad = 0, mayStore = 0, vm = 1 // Vector Slide Instructions