Skip to content

Commit e6ee191

Browse files
[RISCV] Add test case for CASE_VFMA_CHANGE_OPCODE_VV to handle MF4 pseudos (#88947)
The fix was committed in 8cee94e. This adds a test.
1 parent 743d090 commit e6ee191

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

llvm/test/CodeGen/RISCV/rvv/vfmadd-sdnode.ll

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ define <vscale x 1 x half> @vfmadd_vv_nxv1f16(<vscale x 1 x half> %va, <vscale x
3535
ret <vscale x 1 x half> %vd
3636
}
3737

38+
define <vscale x 1 x half> @vfmadd_vv_nxv1f16_commuted(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x half> %vc) {
39+
; ZVFH-LABEL: vfmadd_vv_nxv1f16_commuted:
40+
; ZVFH: # %bb.0:
41+
; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
42+
; ZVFH-NEXT: vfmacc.vv v8, v10, v9
43+
; ZVFH-NEXT: ret
44+
;
45+
; ZVFHMIN-LABEL: vfmadd_vv_nxv1f16_commuted:
46+
; ZVFHMIN: # %bb.0:
47+
; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
48+
; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8
49+
; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
50+
; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v10
51+
; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
52+
; ZVFHMIN-NEXT: vfmadd.vv v9, v8, v11
53+
; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
54+
; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
55+
; ZVFHMIN-NEXT: ret
56+
%vd = call <vscale x 1 x half> @llvm.fma.v1f16(<vscale x 1 x half> %vb, <vscale x 1 x half> %vc, <vscale x 1 x half> %va)
57+
ret <vscale x 1 x half> %vd
58+
}
59+
3860
define <vscale x 1 x half> @vfmadd_vf_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, half %c) {
3961
; ZVFH-LABEL: vfmadd_vf_nxv1f16:
4062
; ZVFH: # %bb.0:

0 commit comments

Comments
 (0)