|
1 | 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 |
| 2 | +; RUN: llc < %s -mtriple=riscv64 -mattr=+v,+zvfh,+zvfbfmin | FileCheck %s --check-prefixes=CHECK,ZVFH |
| 3 | +; RUN: llc < %s -mtriple=riscv64 -mattr=+v,+zvfhmin,+zvfbfmin | FileCheck %s --check-prefixes=CHECK,ZVFHMIN |
| 4 | + |
| 5 | +define <vscale x 2 x float> @vfwadd_same_operand_nxv2bf16(<vscale x 2 x bfloat> %arg, i32 signext %vl) { |
| 6 | +; CHECK-LABEL: vfwadd_same_operand_nxv2bf16: |
| 7 | +; CHECK: # %bb.0: # %bb |
| 8 | +; CHECK-NEXT: slli a0, a0, 32 |
| 9 | +; CHECK-NEXT: srli a0, a0, 32 |
| 10 | +; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma |
| 11 | +; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8 |
| 12 | +; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma |
| 13 | +; CHECK-NEXT: vfadd.vv v8, v9, v9 |
| 14 | +; CHECK-NEXT: ret |
| 15 | +bb: |
| 16 | + %tmp = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2bf16(<vscale x 2 x bfloat> %arg, <vscale x 2 x i1> splat (i1 true), i32 %vl) |
| 17 | + %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) |
| 18 | + ret <vscale x 2 x float> %tmp2 |
| 19 | +} |
| 20 | + |
| 21 | +; Make sure we don't widen vfmadd.vv -> vfwmaccvbf16.vv if there's other |
| 22 | +; unwidenable uses |
| 23 | +define <vscale x 2 x float> @vfwadd_same_operand_nxv2bf16_multiuse(<vscale x 2 x bfloat> %arg, <vscale x 2 x float> %acc, i32 signext %vl, ptr %p) { |
| 24 | +; CHECK-LABEL: vfwadd_same_operand_nxv2bf16_multiuse: |
| 25 | +; CHECK: # %bb.0: # %bb |
| 26 | +; CHECK-NEXT: slli a0, a0, 32 |
| 27 | +; CHECK-NEXT: srli a0, a0, 32 |
| 28 | +; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma |
| 29 | +; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8 |
| 30 | +; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma |
| 31 | +; CHECK-NEXT: vfadd.vv v8, v10, v10 |
| 32 | +; CHECK-NEXT: vfmadd.vv v10, v10, v9 |
| 33 | +; CHECK-NEXT: vs1r.v v10, (a1) |
| 34 | +; CHECK-NEXT: ret |
| 35 | +bb: |
| 36 | + %tmp = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2bf16(<vscale x 2 x bfloat> %arg, <vscale x 2 x i1> splat (i1 true), i32 %vl) |
| 37 | + %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) |
| 38 | + %tmp3 = call <vscale x 2 x float> @llvm.vp.fma.nxv2f32(<vscale x 2 x float> %tmp, <vscale x 2 x float> %tmp, <vscale x 2 x float> %acc, <vscale x 2 x i1> splat (i1 true), i32 %vl) |
| 39 | + store <vscale x 2 x float> %tmp3, ptr %p |
| 40 | + ret <vscale x 2 x float> %tmp2 |
| 41 | +} |
4 | 42 |
|
5 | 43 | define <vscale x 2 x float> @vfwadd_same_operand(<vscale x 2 x half> %arg, i32 signext %vl) {
|
6 | 44 | ; ZVFH-LABEL: vfwadd_same_operand:
|
|
0 commit comments