Skip to content

Commit cd3e811

Browse files
committed
Revert "[RISCV] Add intrinsics for vfmv.f.s and vfmv.s.f"
This reverts commit 46a40c4. I forgot to git add the tests.
1 parent 46a40c4 commit cd3e811

File tree

3 files changed

+3
-68
lines changed

3 files changed

+3
-68
lines changed

llvm/include/llvm/IR/IntrinsicsRISCV.td

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,4 @@ let TargetPrefix = "riscv" in {
349349
[IntrNoMem]>, RISCVVIntrinsic {
350350
let ExtendOperand = 2;
351351
}
352-
353-
def int_riscv_vfmv_f_s : Intrinsic<[LLVMVectorElementType<0>],
354-
[llvm_anyfloat_ty],
355-
[IntrNoMem]>, RISCVVIntrinsic;
356-
def int_riscv_vfmv_s_f : Intrinsic<[llvm_anyfloat_ty],
357-
[LLVMMatchType<0>, LLVMVectorElementType<0>,
358-
llvm_anyint_ty],
359-
[IntrNoMem]>, RISCVVIntrinsic;
360352
} // TargetPrefix = "riscv"

llvm/lib/Target/RISCV/RISCVInstrInfoV.td

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -980,9 +980,8 @@ let hasSideEffects = 0, mayLoad = 0, mayStore = 0, vm = 1 in {
980980
// Floating-Point Scalar Move Instructions
981981
def VFMV_F_S : RVInstV<0b010000, 0b00000, OPFVV, (outs FPR32:$vd),
982982
(ins VR:$vs2), "vfmv.f.s", "$vd, $vs2">;
983-
let Constraints = "$vd = $vd_wb" in
984-
def VFMV_S_F : RVInstV2<0b010000, 0b00000, OPFVF, (outs VR:$vd_wb),
985-
(ins VR:$vd, FPR32:$rs1), "vfmv.s.f", "$vd, $rs1">;
983+
def VFMV_S_F : RVInstV2<0b010000, 0b00000, OPFVF, (outs VR:$vd),
984+
(ins FPR32:$rs1), "vfmv.s.f", "$vd, $rs1">;
986985

987986
} // hasSideEffects = 0, mayLoad = 0, mayStore = 0, vm = 1
988987
} // Predicates = [HasStdExtV, HasStdExtF]

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,37 +1370,12 @@ let mayLoad = 0, mayStore = 0, hasSideEffects = 0, usesCustomInserter = 1,
13701370
Constraints = "$rd = $rs1" in
13711371
def PseudoVMV_S_X # "_" # m.MX: Pseudo<(outs m.vrclass:$rd),
13721372
(ins m.vrclass:$rs1, GPR:$rs2,
1373-
GPR:$vl, ixlenimm:$sew),
1373+
GPR:$vl, ixlenimm:$sew),
13741374
[]>, RISCVVPseudo;
13751375
}
13761376
}
13771377
}
1378-
} // Predicates = [HasStdExtV]
1379-
1380-
//===----------------------------------------------------------------------===//
1381-
// 17.2. Floating-Point Scalar Move Instructions
1382-
//===----------------------------------------------------------------------===//
1383-
1384-
let Predicates = [HasStdExtV, HasStdExtF] in {
1385-
let mayLoad = 0, mayStore = 0, hasSideEffects = 0, usesCustomInserter = 1,
1386-
Uses = [VL, VTYPE] in {
1387-
foreach m = MxList.m in {
1388-
let VLMul = m.value in {
1389-
let SEWIndex = 2, BaseInstr = VFMV_F_S in
1390-
def PseudoVFMV_F_S # "_" # m.MX : Pseudo<(outs FPR32:$rd),
1391-
(ins m.vrclass:$rs2,
1392-
ixlenimm:$sew),
1393-
[]>, RISCVVPseudo;
1394-
let VLIndex = 3, SEWIndex = 4, BaseInstr = VFMV_S_F,
1395-
Constraints = "$rd = $rs1" in
1396-
def PseudoVFMV_S_F # "_" # m.MX : Pseudo<(outs m.vrclass:$rd),
1397-
(ins m.vrclass:$rs1, FPR32:$rs2,
1398-
GPR:$vl, ixlenimm:$sew),
1399-
[]>, RISCVVPseudo;
1400-
}
1401-
}
14021378
}
1403-
} // Predicates = [HasStdExtV, HasStdExtF]
14041379

14051380
//===----------------------------------------------------------------------===//
14061381
// Patterns.
@@ -1582,34 +1557,3 @@ foreach vti = AllIntegerVectors in {
15821557
(vti.Vector $rs1), $rs2, (NoX0 GPR:$vl), vti.SEW)>;
15831558
}
15841559
} // Predicates = [HasStdExtV]
1585-
1586-
//===----------------------------------------------------------------------===//
1587-
// 17.2. Floating-Point Scalar Move Instructions
1588-
//===----------------------------------------------------------------------===//
1589-
1590-
let Predicates = [HasStdExtV, HasStdExtF] in {
1591-
foreach fvti = AllFloatVectors in {
1592-
defvar instr = !cast<Instruction>("PseudoVFMV_F_S_" # fvti.LMul.MX);
1593-
def : Pat<(fvti.Scalar (int_riscv_vfmv_f_s (fvti.Vector fvti.RegClass:$rs2))),
1594-
// Floating point instructions with a scalar result will always
1595-
// generate the result in a register of class FPR32. When dealing
1596-
// with the f64 variant of a pattern we need to promote the FPR32
1597-
// subregister generated by the instruction to the FPR64 base
1598-
// register expected by the type in the pattern
1599-
!cond(!eq(!cast<string>(fvti.ScalarRegClass),
1600-
!cast<string>(FPR64)):
1601-
(SUBREG_TO_REG (i32 -1),
1602-
(instr $rs2, fvti.SEW), sub_32),
1603-
!eq(!cast<string>(fvti.ScalarRegClass),
1604-
!cast<string>(FPR16)):
1605-
(EXTRACT_SUBREG (instr $rs2, fvti.SEW), sub_16),
1606-
!eq(1, 1):
1607-
(instr $rs2, fvti.SEW))>;
1608-
1609-
def : Pat<(fvti.Vector (int_riscv_vfmv_s_f (fvti.Vector fvti.RegClass:$rs1),
1610-
(fvti.Scalar fvti.ScalarRegClass:$rs2), GPR:$vl)),
1611-
(!cast<Instruction>("PseudoVFMV_S_F_" # fvti.LMul.MX)
1612-
(fvti.Vector $rs1), ToFPR32<fvti.Scalar, fvti.ScalarRegClass, "rs2">.ret,
1613-
(NoX0 GPR:$vl), fvti.SEW)>;
1614-
}
1615-
} // Predicates = [HasStdExtV, HasStdExtF]

0 commit comments

Comments
 (0)