1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=riscv64 -mattr=+v,+zvfh | FileCheck %s --check-prefixes=ZVFH
3 ; RUN: llc < %s -mtriple=riscv64 -mattr=+v,+zvfhmin | FileCheck %s --check-prefixes=ZVFHMIN
5 define <vscale x 2 x float> @vfwadd_same_operand(<vscale x 2 x half> %arg, i32 signext %vl) {
6 ; ZVFH-LABEL: vfwadd_same_operand:
8 ; ZVFH-NEXT: slli a0, a0, 32
9 ; ZVFH-NEXT: srli a0, a0, 32
10 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
11 ; ZVFH-NEXT: vfwadd.vv v9, v8, v8
12 ; ZVFH-NEXT: vmv1r.v v8, v9
15 ; ZVFHMIN-LABEL: vfwadd_same_operand:
16 ; ZVFHMIN: # %bb.0: # %bb
17 ; ZVFHMIN-NEXT: slli a0, a0, 32
18 ; ZVFHMIN-NEXT: srli a0, a0, 32
19 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
20 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
21 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
22 ; ZVFHMIN-NEXT: vfadd.vv v8, v9, v9
25 %tmp = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %arg, <vscale x 2 x i1> splat (i1 true), i32 %vl)
26 %tmp2 = call <vscale x 2 x float> @llvm.vp.fadd.nxv2f32(<vscale x 2 x float> %tmp, <vscale x 2 x float> %tmp, <vscale x 2 x i1> splat (i1 true), i32 %vl)
27 ret <vscale x 2 x float> %tmp2
30 define <vscale x 2 x float> @vfwadd_tu(<vscale x 2 x half> %arg, <vscale x 2 x float> %arg1, i32 signext %arg2) {
31 ; ZVFH-LABEL: vfwadd_tu:
32 ; ZVFH: # %bb.0: # %bb
33 ; ZVFH-NEXT: slli a0, a0, 32
34 ; ZVFH-NEXT: srli a0, a0, 32
35 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
36 ; ZVFH-NEXT: vfwadd.wv v9, v9, v8
37 ; ZVFH-NEXT: vmv1r.v v8, v9
40 ; ZVFHMIN-LABEL: vfwadd_tu:
41 ; ZVFHMIN: # %bb.0: # %bb
42 ; ZVFHMIN-NEXT: slli a0, a0, 32
43 ; ZVFHMIN-NEXT: srli a0, a0, 32
44 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
45 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
46 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, tu, ma
47 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v10
48 ; ZVFHMIN-NEXT: vmv1r.v v8, v9
51 %tmp = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %arg, <vscale x 2 x i1> splat (i1 true), i32 %arg2)
52 %tmp3 = call <vscale x 2 x float> @llvm.vp.fadd.nxv2f32(<vscale x 2 x float> %arg1, <vscale x 2 x float> %tmp, <vscale x 2 x i1> splat (i1 true), i32 %arg2)
53 %tmp4 = call <vscale x 2 x float> @llvm.vp.merge.nxv2f32(<vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %tmp3, <vscale x 2 x float> %arg1, i32 %arg2)
54 ret <vscale x 2 x float> %tmp4
57 declare <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
58 declare <vscale x 2 x float> @llvm.vp.fadd.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>, <vscale x 2 x i1>, i32)
59 declare <vscale x 2 x float> @llvm.vp.merge.nxv2f32(<vscale x 2 x i1>, <vscale x 2 x float>, <vscale x 2 x float>, i32)