1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zvfh,+v,+zvfbfmin -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zvfh,+v,+zvfbfmin -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
118 declare <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2bf16(<2 x bfloat>, metadata)
119 define <2 x float> @vfpext_v2bf16_v2f32(<2 x bfloat> %va) strictfp {
120 ; CHECK-LABEL: vfpext_v2bf16_v2f32:
122 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
123 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
124 ; CHECK-NEXT: vmv1r.v v8, v9
126 %evec = call <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2bf16(<2 x bfloat> %va, metadata !"fpexcept.strict")
127 ret <2 x float> %evec
130 declare <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2bf16(<2 x bfloat>, metadata)
131 define <2 x double> @vfpext_v2bf16_v2f64(<2 x bfloat> %va) strictfp {
132 ; CHECK-LABEL: vfpext_v2bf16_v2f64:
134 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
135 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
136 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
137 ; CHECK-NEXT: vfwcvt.f.f.v v8, v9
139 %evec = call <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2bf16(<2 x bfloat> %va, metadata !"fpexcept.strict")
140 ret <2 x double> %evec
143 declare <4 x float> @llvm.experimental.constrained.fpext.v4f32.v4bf16(<4 x bfloat>, metadata)
144 define <4 x float> @vfpext_v4bf16_v4f32(<4 x bfloat> %va) strictfp {
145 ; CHECK-LABEL: vfpext_v4bf16_v4f32:
147 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
148 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
149 ; CHECK-NEXT: vmv1r.v v8, v9
151 %evec = call <4 x float> @llvm.experimental.constrained.fpext.v4f32.v4bf16(<4 x bfloat> %va, metadata !"fpexcept.strict")
152 ret <4 x float> %evec
155 declare <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4bf16(<4 x bfloat>, metadata)
156 define <4 x double> @vfpext_v4bf16_v4f64(<4 x bfloat> %va) strictfp {
157 ; CHECK-LABEL: vfpext_v4bf16_v4f64:
159 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
160 ; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8
161 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
162 ; CHECK-NEXT: vfwcvt.f.f.v v8, v10
164 %evec = call <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4bf16(<4 x bfloat> %va, metadata !"fpexcept.strict")
165 ret <4 x double> %evec
168 declare <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8bf16(<8 x bfloat>, metadata)
169 define <8 x float> @vfpext_v8bf16_v8f32(<8 x bfloat> %va) strictfp {
170 ; CHECK-LABEL: vfpext_v8bf16_v8f32:
172 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
173 ; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8
174 ; CHECK-NEXT: vmv2r.v v8, v10
176 %evec = call <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8bf16(<8 x bfloat> %va, metadata !"fpexcept.strict")
177 ret <8 x float> %evec
180 declare <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8bf16(<8 x bfloat>, metadata)
181 define <8 x double> @vfpext_v8bf16_v8f64(<8 x bfloat> %va) strictfp {
182 ; CHECK-LABEL: vfpext_v8bf16_v8f64:
184 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
185 ; CHECK-NEXT: vfwcvtbf16.f.f.v v12, v8
186 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
187 ; CHECK-NEXT: vfwcvt.f.f.v v8, v12
189 %evec = call <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8bf16(<8 x bfloat> %va, metadata !"fpexcept.strict")
190 ret <8 x double> %evec