1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s
7 declare <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2f16(<2 x half>, metadata)
8 define <2 x float> @vfpext_v2f16_v2f32(<2 x half> %va) strictfp {
9 ; CHECK-LABEL: vfpext_v2f16_v2f32:
11 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
12 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
13 ; CHECK-NEXT: vmv1r.v v8, v9
15 %evec = call <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2f16(<2 x half> %va, metadata !"fpexcept.strict")
19 declare <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f16(<2 x half>, metadata)
20 define <2 x double> @vfpext_v2f16_v2f64(<2 x half> %va) strictfp {
21 ; CHECK-LABEL: vfpext_v2f16_v2f64:
23 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
24 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
25 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
26 ; CHECK-NEXT: vfwcvt.f.f.v v8, v9
28 %evec = call <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f16(<2 x half> %va, metadata !"fpexcept.strict")
29 ret <2 x double> %evec
32 declare <4 x float> @llvm.experimental.constrained.fpext.v4f32.v4f16(<4 x half>, metadata)
33 define <4 x float> @vfpext_v4f16_v4f32(<4 x half> %va) strictfp {
34 ; CHECK-LABEL: vfpext_v4f16_v4f32:
36 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
37 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
38 ; CHECK-NEXT: vmv1r.v v8, v9
40 %evec = call <4 x float> @llvm.experimental.constrained.fpext.v4f32.v4f16(<4 x half> %va, metadata !"fpexcept.strict")
44 declare <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f16(<4 x half>, metadata)
45 define <4 x double> @vfpext_v4f16_v4f64(<4 x half> %va) strictfp {
46 ; CHECK-LABEL: vfpext_v4f16_v4f64:
48 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
49 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
50 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
51 ; CHECK-NEXT: vfwcvt.f.f.v v8, v10
53 %evec = call <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f16(<4 x half> %va, metadata !"fpexcept.strict")
54 ret <4 x double> %evec
57 declare <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8f16(<8 x half>, metadata)
58 define <8 x float> @vfpext_v8f16_v8f32(<8 x half> %va) strictfp {
59 ; CHECK-LABEL: vfpext_v8f16_v8f32:
61 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
62 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
63 ; CHECK-NEXT: vmv2r.v v8, v10
65 %evec = call <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8f16(<8 x half> %va, metadata !"fpexcept.strict")
69 declare <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f16(<8 x half>, metadata)
70 define <8 x double> @vfpext_v8f16_v8f64(<8 x half> %va) strictfp {
71 ; CHECK-LABEL: vfpext_v8f16_v8f64:
73 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
74 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
75 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
76 ; CHECK-NEXT: vfwcvt.f.f.v v8, v12
78 %evec = call <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f16(<8 x half> %va, metadata !"fpexcept.strict")
79 ret <8 x double> %evec
82 declare <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f32(<2 x float>, metadata)
83 define <2 x double> @vfpext_v2f32_v2f64(<2 x float> %va) strictfp {
84 ; CHECK-LABEL: vfpext_v2f32_v2f64:
86 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
87 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
88 ; CHECK-NEXT: vmv1r.v v8, v9
90 %evec = call <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f32(<2 x float> %va, metadata !"fpexcept.strict")
91 ret <2 x double> %evec
94 declare <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f32(<4 x float>, metadata)
95 define <4 x double> @vfpext_v4f32_v4f64(<4 x float> %va) strictfp {
96 ; CHECK-LABEL: vfpext_v4f32_v4f64:
98 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
99 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
100 ; CHECK-NEXT: vmv2r.v v8, v10
102 %evec = call <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f32(<4 x float> %va, metadata !"fpexcept.strict")
103 ret <4 x double> %evec
106 declare <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f32(<8 x float>, metadata)
107 define <8 x double> @vfpext_v8f32_v8f64(<8 x float> %va) strictfp {
108 ; CHECK-LABEL: vfpext_v8f32_v8f64:
110 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
111 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
112 ; CHECK-NEXT: vmv4r.v v8, v12
114 %evec = call <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f32(<8 x float> %va, metadata !"fpexcept.strict")
115 ret <8 x double> %evec