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
6 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfhmin,+v -target-abi=ilp32d \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s
8 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfhmin,+v -target-abi=lp64d \
9 ; RUN: -verify-machineinstrs < %s | FileCheck %s
11 define <vscale x 1 x float> @vfpext_nxv1f16_nxv1f32(<vscale x 1 x half> %va) {
13 ; CHECK-LABEL: vfpext_nxv1f16_nxv1f32:
15 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
16 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
17 ; CHECK-NEXT: vmv1r.v v8, v9
19 %evec = fpext <vscale x 1 x half> %va to <vscale x 1 x float>
20 ret <vscale x 1 x float> %evec
23 define <vscale x 1 x double> @vfpext_nxv1f16_nxv1f64(<vscale x 1 x half> %va) {
25 ; CHECK-LABEL: vfpext_nxv1f16_nxv1f64:
27 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
28 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
29 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
30 ; CHECK-NEXT: vfwcvt.f.f.v v8, v9
32 %evec = fpext <vscale x 1 x half> %va to <vscale x 1 x double>
33 ret <vscale x 1 x double> %evec
36 define <vscale x 2 x float> @vfpext_nxv2f16_nxv2f32(<vscale x 2 x half> %va) {
38 ; CHECK-LABEL: vfpext_nxv2f16_nxv2f32:
40 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
41 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
42 ; CHECK-NEXT: vmv1r.v v8, v9
44 %evec = fpext <vscale x 2 x half> %va to <vscale x 2 x float>
45 ret <vscale x 2 x float> %evec
48 define <vscale x 2 x double> @vfpext_nxv2f16_nxv2f64(<vscale x 2 x half> %va) {
50 ; CHECK-LABEL: vfpext_nxv2f16_nxv2f64:
52 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
53 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
54 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
55 ; CHECK-NEXT: vfwcvt.f.f.v v8, v10
57 %evec = fpext <vscale x 2 x half> %va to <vscale x 2 x double>
58 ret <vscale x 2 x double> %evec
61 define <vscale x 4 x float> @vfpext_nxv4f16_nxv4f32(<vscale x 4 x half> %va) {
63 ; CHECK-LABEL: vfpext_nxv4f16_nxv4f32:
65 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
66 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
67 ; CHECK-NEXT: vmv2r.v v8, v10
69 %evec = fpext <vscale x 4 x half> %va to <vscale x 4 x float>
70 ret <vscale x 4 x float> %evec
73 define <vscale x 4 x double> @vfpext_nxv4f16_nxv4f64(<vscale x 4 x half> %va) {
75 ; CHECK-LABEL: vfpext_nxv4f16_nxv4f64:
77 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
78 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
79 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
80 ; CHECK-NEXT: vfwcvt.f.f.v v8, v12
82 %evec = fpext <vscale x 4 x half> %va to <vscale x 4 x double>
83 ret <vscale x 4 x double> %evec
86 define <vscale x 8 x float> @vfpext_nxv8f16_nxv8f32(<vscale x 8 x half> %va) {
88 ; CHECK-LABEL: vfpext_nxv8f16_nxv8f32:
90 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
91 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
92 ; CHECK-NEXT: vmv4r.v v8, v12
94 %evec = fpext <vscale x 8 x half> %va to <vscale x 8 x float>
95 ret <vscale x 8 x float> %evec
98 define <vscale x 8 x double> @vfpext_nxv8f16_nxv8f64(<vscale x 8 x half> %va) {
100 ; CHECK-LABEL: vfpext_nxv8f16_nxv8f64:
102 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
103 ; CHECK-NEXT: vfwcvt.f.f.v v16, v8
104 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
105 ; CHECK-NEXT: vfwcvt.f.f.v v8, v16
107 %evec = fpext <vscale x 8 x half> %va to <vscale x 8 x double>
108 ret <vscale x 8 x double> %evec
111 define <vscale x 16 x float> @vfpext_nxv16f16_nxv16f32(<vscale x 16 x half> %va) {
113 ; CHECK-LABEL: vfpext_nxv16f16_nxv16f32:
115 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
116 ; CHECK-NEXT: vfwcvt.f.f.v v16, v8
117 ; CHECK-NEXT: vmv8r.v v8, v16
119 %evec = fpext <vscale x 16 x half> %va to <vscale x 16 x float>
120 ret <vscale x 16 x float> %evec
123 define <vscale x 1 x double> @vfpext_nxv1f32_nxv1f64(<vscale x 1 x float> %va) {
125 ; CHECK-LABEL: vfpext_nxv1f32_nxv1f64:
127 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
128 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
129 ; CHECK-NEXT: vmv1r.v v8, v9
131 %evec = fpext <vscale x 1 x float> %va to <vscale x 1 x double>
132 ret <vscale x 1 x double> %evec
135 define <vscale x 2 x double> @vfpext_nxv2f32_nxv2f64(<vscale x 2 x float> %va) {
137 ; CHECK-LABEL: vfpext_nxv2f32_nxv2f64:
139 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
140 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
141 ; CHECK-NEXT: vmv2r.v v8, v10
143 %evec = fpext <vscale x 2 x float> %va to <vscale x 2 x double>
144 ret <vscale x 2 x double> %evec
147 define <vscale x 4 x double> @vfpext_nxv4f32_nxv4f64(<vscale x 4 x float> %va) {
149 ; CHECK-LABEL: vfpext_nxv4f32_nxv4f64:
151 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
152 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
153 ; CHECK-NEXT: vmv4r.v v8, v12
155 %evec = fpext <vscale x 4 x float> %va to <vscale x 4 x double>
156 ret <vscale x 4 x double> %evec
159 define <vscale x 8 x double> @vfpext_nxv8f32_nxv8f64(<vscale x 8 x float> %va) {
161 ; CHECK-LABEL: vfpext_nxv8f32_nxv8f64:
163 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
164 ; CHECK-NEXT: vfwcvt.f.f.v v16, v8
165 ; CHECK-NEXT: vmv8r.v v8, v16
167 %evec = fpext <vscale x 8 x float> %va to <vscale x 8 x double>
168 ret <vscale x 8 x double> %evec