Skip to content

Commit cc6a864

Browse files
[RISCV][VLOPT] Add support for vfrec7.v (#146918)
Add support for the vfrec7.v instruction in the RISC-V VLOptimizer.
1 parent 2472cdc commit cc6a864

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,8 @@ static bool isSupportedInstr(const MachineInstr &MI) {
11071107
case RISCV::VFSQRT_V:
11081108
// Vector Floating-Point Reciprocal Square-Root Estimate Instruction
11091109
case RISCV::VFRSQRT7_V:
1110+
// Vector Floating-Point Reciprocal Estimate Instruction
1111+
case RISCV::VFREC7_V:
11101112
// Vector Floating-Point MIN/MAX Instructions
11111113
case RISCV::VFMIN_VF:
11121114
case RISCV::VFMIN_VV:

llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5380,12 +5380,11 @@ define <vscale x 4 x double> @vfrec7(<vscale x 4 x float> %a) {
53805380
;
53815381
; VLOPT-LABEL: vfrec7:
53825382
; VLOPT: # %bb.0:
5383-
; VLOPT-NEXT: vsetivli zero, 7, e32, m2, ta, ma
5383+
; VLOPT-NEXT: vsetivli zero, 6, e32, m2, ta, ma
53845384
; VLOPT-NEXT: vmv2r.v v12, v8
53855385
; VLOPT-NEXT: fsrmi a0, 0
53865386
; VLOPT-NEXT: vfrec7.v v14, v8
53875387
; VLOPT-NEXT: fsrm a0
5388-
; VLOPT-NEXT: vsetivli zero, 6, e32, m2, ta, ma
53895388
; VLOPT-NEXT: vfwmacc.vv v8, v12, v14
53905389
; VLOPT-NEXT: ret
53915390
%1 = call <vscale x 4 x float> @llvm.riscv.vfrec7.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %a, iXLen 0, iXLen 7)

0 commit comments

Comments
 (0)