[PATCH] D158711: [RISCV] Add missed HasRoundModeOp for VPseudoUnaryMask_FRM/VPseudoUnaryMask_FRM.
Yeting Kuo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 24 06:45:43 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG243d8cdb0314: [RISCV] Add missed HasRoundModeOp for VPseudoUnaryMask_FRM/VPseudoUnaryMask_FRM. (authored by fakepaper56).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158711/new/
https://reviews.llvm.org/D158711
Files:
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-masked-vops.ll
Index: llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-masked-vops.ll
===================================================================
--- llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-masked-vops.ll
+++ llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-masked-vops.ll
@@ -240,3 +240,21 @@
%b = call <vscale x 2 x i32> @llvm.riscv.vmerge.nxv2i32.nxv2i32(<vscale x 2 x i32> %passthru, <vscale x 2 x i32> %passthru, <vscale x 2 x i32> %a, <vscale x 2 x i1> %mask, i64 3)
ret <vscale x 2 x i32> %b
}
+
+; Test VFCVT_RM
+declare <vscale x 2 x float> @llvm.floor.nxv2f32(<vscale x 2 x float>)
+declare <vscale x 2 x i32> @llvm.vp.merge.nxv2i32(<vscale x 2 x i1>, <vscale x 2 x i32>, <vscale x 2 x i32>, i32)
+define <vscale x 2 x i32> @vmerge_vfcvt_rm(<vscale x 2 x i32> %passthru, <vscale x 2 x float> %a, <vscale x 2 x i1> %m, i32 zeroext %evl) {
+; CHECK-LABEL: vmerge_vfcvt_rm:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: fsrmi a1, 2
+; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, mu
+; CHECK-NEXT: vfcvt.x.f.v v8, v9, v0.t
+; CHECK-NEXT: fsrm a1
+; CHECK-NEXT: ret
+entry:
+ %floor = call <vscale x 2 x float> @llvm.floor.nxv2f32(<vscale x 2 x float> %a)
+ %i = fptosi <vscale x 2 x float> %floor to <vscale x 2 x i32>
+ %res = call <vscale x 2 x i32> @llvm.vp.merge.nxv2i32(<vscale x 2 x i1> %m, <vscale x 2 x i32> %i, <vscale x 2 x i32> %passthru, i32 %evl)
+ ret <vscale x 2 x i32> %res
+}
Index: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
@@ -1102,6 +1102,7 @@
let HasVLOp = 1;
let HasSEWOp = 1;
let HasVecPolicyOp = 1;
+ let HasRoundModeOp = 1;
let usesCustomInserter = 1;
}
@@ -1120,6 +1121,7 @@
let HasSEWOp = 1;
let HasVecPolicyOp = 1;
let UsesMaskPolicy = 1;
+ let HasRoundModeOp = 1;
let usesCustomInserter = 1;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158711.553107.patch
Type: text/x-patch
Size: 1966 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230824/e4a30c12/attachment.bin>
More information about the llvm-commits
mailing list