[flang][openacc] Use OpenACC terminator instead of fir.unreachable after Stop stmt...
[llvm-project.git] / flang / test / Lower / PowerPC / ppc-vec-convert.f90
blob587d7fc17e6af06ef3d5342e112411175562d288
1 ! RUN: bbc -emit-fir %s -o - | FileCheck --check-prefixes="CHECK-FIR" %s
2 ! RUN: %flang_fc1 -emit-fir %s -o - | fir-opt --fir-to-llvm-ir | FileCheck --check-prefixes="CHECK-LLVMIR" %s
3 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck --check-prefixes="CHECK" %s
4 ! REQUIRES: target=powerpc{{.*}}
6 !---------
7 ! vec_ctf
8 !---------
9 ! CHECK-LABEL: vec_ctf_test_i4i1
10 subroutine vec_ctf_test_i4i1(arg1)
11 vector(integer(4)), intent(in) :: arg1
12 vector(real(4)) :: r
13 r = vec_ctf(arg1, 1_1)
15 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
16 ! CHECK-FIR: %[[arg2:.*]] = arith.constant 1 : i8
17 ! CHECK-FIR: %[[carg2:.*]] = fir.convert %[[arg2]] : (i8) -> i32
18 ! CHECK-FIR: %[[r:.*]] = fir.call @llvm.ppc.altivec.vcfsx(%[[arg1]], %[[carg2]]) fastmath<contract> : (!fir.vector<4:i32>, i32) -> !fir.vector<4:f32>
19 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
21 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
22 ! CHECK-LLVMIR: %[[arg2:.*]] = llvm.mlir.constant(1 : i8) : i8
23 ! CHECK-LLVMIR: %[[carg2:.*]] = llvm.sext %[[arg2]] : i8 to i32
24 ! CHECK-LLVMIR: %[[r:.*]] = llvm.call @llvm.ppc.altivec.vcfsx(%[[arg1]], %[[carg2]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<4xi32>, i32) -> vector<4xf32>
25 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
27 ! CHECK: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
28 ! CHECK: %[[r:.*]] = call contract <4 x float> @llvm.ppc.altivec.vcfsx(<4 x i32> %[[arg1]], i32 1)
29 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
30 end subroutine vec_ctf_test_i4i1
32 ! CHECK-LABEL: vec_ctf_test_i4i2
33 subroutine vec_ctf_test_i4i2(arg1)
34 vector(integer(4)), intent(in) :: arg1
35 vector(real(4)) :: r
36 r = vec_ctf(arg1, 1_2)
38 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
39 ! CHECK-FIR: %[[arg2:.*]] = arith.constant 1 : i16
40 ! CHECK-FIR: %[[carg2:.*]] = fir.convert %[[arg2]] : (i16) -> i32
41 ! CHECK-FIR: %[[r:.*]] = fir.call @llvm.ppc.altivec.vcfsx(%[[arg1]], %[[carg2]]) fastmath<contract> : (!fir.vector<4:i32>, i32) -> !fir.vector<4:f32>
42 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
44 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
45 ! CHECK-LLVMIR: %[[arg2:.*]] = llvm.mlir.constant(1 : i16) : i16
46 ! CHECK-LLVMIR: %[[carg2:.*]] = llvm.sext %[[arg2]] : i16 to i32
47 ! CHECK-LLVMIR: %[[r:.*]] = llvm.call @llvm.ppc.altivec.vcfsx(%[[arg1]], %[[carg2]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<4xi32>, i32) -> vector<4xf32>
48 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
50 ! CHECK: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
51 ! CHECK: %[[r:.*]] = call contract <4 x float> @llvm.ppc.altivec.vcfsx(<4 x i32> %[[arg1]], i32 1)
52 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
53 end subroutine vec_ctf_test_i4i2
55 ! CHECK-LABEL: vec_ctf_test_i4i4
56 subroutine vec_ctf_test_i4i4(arg1)
57 vector(integer(4)), intent(in) :: arg1
58 vector(real(4)) :: r
59 r = vec_ctf(arg1, 1_4)
61 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
62 ! CHECK-FIR: %[[arg2:.*]] = arith.constant 1 : i32
63 ! CHECK-FIR: %[[r:.*]] = fir.call @llvm.ppc.altivec.vcfsx(%[[arg1]], %[[arg2]]) fastmath<contract> : (!fir.vector<4:i32>, i32) -> !fir.vector<4:f32>
64 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
66 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
67 ! CHECK-LLVMIR: %[[arg2:.*]] = llvm.mlir.constant(1 : i32) : i32
68 ! CHECK-LLVMIR: %[[r:.*]] = llvm.call @llvm.ppc.altivec.vcfsx(%[[arg1]], %[[arg2]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<4xi32>, i32) -> vector<4xf32>
69 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
71 ! CHECK: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
72 ! CHECK: %[[r:.*]] = call contract <4 x float> @llvm.ppc.altivec.vcfsx(<4 x i32> %[[arg1]], i32 1)
73 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
74 end subroutine vec_ctf_test_i4i4
76 ! CHECK-LABEL: vec_ctf_test_i4i8
77 subroutine vec_ctf_test_i4i8(arg1)
78 vector(integer(4)), intent(in) :: arg1
79 vector(real(4)) :: r
80 r = vec_ctf(arg1, 1_8)
82 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
83 ! CHECK-FIR: %[[arg2:.*]] = arith.constant 1 : i64
84 ! CHECK-FIR: %[[carg2:.*]] = fir.convert %[[arg2]] : (i64) -> i32
85 ! CHECK-FIR: %[[r:.*]] = fir.call @llvm.ppc.altivec.vcfsx(%[[arg1]], %[[carg2]]) fastmath<contract> : (!fir.vector<4:i32>, i32) -> !fir.vector<4:f32>
86 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
88 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
89 ! CHECK-LLVMIR: %[[arg2:.*]] = llvm.mlir.constant(1 : i64) : i64
90 ! CHECK-LLVMIR: %[[carg2:.*]] = llvm.trunc %[[arg2]] : i64 to i32
91 ! CHECK-LLVMIR: %[[r:.*]] = llvm.call @llvm.ppc.altivec.vcfsx(%[[arg1]], %[[carg2]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<4xi32>, i32) -> vector<4xf32>
92 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
94 ! CHECK: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
95 ! CHECK: %[[r:.*]] = call contract <4 x float> @llvm.ppc.altivec.vcfsx(<4 x i32> %[[arg1]], i32 1)
96 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
97 end subroutine vec_ctf_test_i4i8
99 ! CHECK-LABEL: vec_ctf_test_i8i1
100 subroutine vec_ctf_test_i8i1(arg1)
101 vector(integer(8)), intent(in) :: arg1
102 vector(real(8)) :: r
103 r = vec_ctf(arg1, 3_1)
105 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
106 ! CHECK-FIR: %[[varg:.*]] = fir.convert %[[arg1]] : (!fir.vector<2:i64>) -> vector<2xi64>
107 ! CHECK-FIR: %[[carg:.*]] = llvm.sitofp %[[varg]] : vector<2xi64> to vector<2xf64>
108 ! CHECK-FIR: %[[cst:.*]] = arith.constant dense<1.250000e-01> : vector<2xf64>
109 ! CHECK-FIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
110 ! CHECK-FIR: %[[cr:.*]] = fir.convert %[[r]] : (vector<2xf64>) -> !fir.vector<2:f64>
111 ! CHECK-FIR: fir.store %[[cr]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
113 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
114 ! CHECK-LLVMIR: %[[carg:.*]] = llvm.sitofp %[[arg1]] : vector<2xi64> to vector<2xf64>
115 ! CHECK-LLVMIR: %[[cst:.*]] = llvm.mlir.constant(dense<1.250000e-01> : vector<2xf64>) : vector<2xf64>
116 ! CHECK-LLVMIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
117 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
119 ! CHECK: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
120 ! CHECK: %[[carg:.*]] = sitofp <2 x i64> %[[arg1]] to <2 x double>
121 ! CHECK: %[[r:.*]] = fmul <2 x double> %[[carg]], <double 1.250000e-01, double 1.250000e-01>
122 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
123 end subroutine vec_ctf_test_i8i1
125 ! CHECK-LABEL: vec_ctf_test_i8i2
126 subroutine vec_ctf_test_i8i2(arg1)
127 vector(integer(8)), intent(in) :: arg1
128 vector(real(8)) :: r
129 r = vec_ctf(arg1, 3_2)
131 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
132 ! CHECK-FIR: %[[varg:.*]] = fir.convert %[[arg1]] : (!fir.vector<2:i64>) -> vector<2xi64>
133 ! CHECK-FIR: %[[carg:.*]] = llvm.sitofp %[[varg]] : vector<2xi64> to vector<2xf64>
134 ! CHECK-FIR: %[[cst:.*]] = arith.constant dense<1.250000e-01> : vector<2xf64>
135 ! CHECK-FIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
136 ! CHECK-FIR: %[[cr:.*]] = fir.convert %[[r]] : (vector<2xf64>) -> !fir.vector<2:f64>
137 ! CHECK-FIR: fir.store %[[cr]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
139 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
140 ! CHECK-LLVMIR: %[[carg:.*]] = llvm.sitofp %[[arg1]] : vector<2xi64> to vector<2xf64>
141 ! CHECK-LLVMIR: %[[cst:.*]] = llvm.mlir.constant(dense<1.250000e-01> : vector<2xf64>) : vector<2xf64>
142 ! CHECK-LLVMIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
143 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
145 ! CHECK: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
146 ! CHECK: %[[carg:.*]] = sitofp <2 x i64> %[[arg1]] to <2 x double>
147 ! CHECK: %[[r:.*]] = fmul <2 x double> %[[carg]], <double 1.250000e-01, double 1.250000e-01>
148 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
149 end subroutine vec_ctf_test_i8i2
151 ! CHECK-LABEL: vec_ctf_test_i8i4
152 subroutine vec_ctf_test_i8i4(arg1)
153 vector(integer(8)), intent(in) :: arg1
154 vector(real(8)) :: r
155 r = vec_ctf(arg1, 3_4)
157 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
158 ! CHECK-FIR: %[[varg:.*]] = fir.convert %[[arg1]] : (!fir.vector<2:i64>) -> vector<2xi64>
159 ! CHECK-FIR: %[[carg:.*]] = llvm.sitofp %[[varg]] : vector<2xi64> to vector<2xf64>
160 ! CHECK-FIR: %[[cst:.*]] = arith.constant dense<1.250000e-01> : vector<2xf64>
161 ! CHECK-FIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
162 ! CHECK-FIR: %[[cr:.*]] = fir.convert %[[r]] : (vector<2xf64>) -> !fir.vector<2:f64>
163 ! CHECK-FIR: fir.store %[[cr]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
165 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
166 ! CHECK-LLVMIR: %[[carg:.*]] = llvm.sitofp %[[arg1]] : vector<2xi64> to vector<2xf64>
167 ! CHECK-LLVMIR: %[[cst:.*]] = llvm.mlir.constant(dense<1.250000e-01> : vector<2xf64>) : vector<2xf64>
168 ! CHECK-LLVMIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
169 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
171 ! CHECK: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
172 ! CHECK: %[[carg:.*]] = sitofp <2 x i64> %[[arg1]] to <2 x double>
173 ! CHECK: %[[r:.*]] = fmul <2 x double> %[[carg]], <double 1.250000e-01, double 1.250000e-01>
174 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
175 end subroutine vec_ctf_test_i8i4
177 ! CHECK-LABEL: vec_ctf_test_i8i8
178 subroutine vec_ctf_test_i8i8(arg1)
179 vector(integer(8)), intent(in) :: arg1
180 vector(real(8)) :: r
181 r = vec_ctf(arg1, 3_8)
183 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
184 ! CHECK-FIR: %[[varg:.*]] = fir.convert %[[arg1]] : (!fir.vector<2:i64>) -> vector<2xi64>
185 ! CHECK-FIR: %[[carg:.*]] = llvm.sitofp %[[varg]] : vector<2xi64> to vector<2xf64>
186 ! CHECK-FIR: %[[cst:.*]] = arith.constant dense<1.250000e-01> : vector<2xf64>
187 ! CHECK-FIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
188 ! CHECK-FIR: %[[cr:.*]] = fir.convert %[[r]] : (vector<2xf64>) -> !fir.vector<2:f64>
189 ! CHECK-FIR: fir.store %[[cr]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
191 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
192 ! CHECK-LLVMIR: %[[carg:.*]] = llvm.sitofp %[[arg1]] : vector<2xi64> to vector<2xf64>
193 ! CHECK-LLVMIR: %[[cst:.*]] = llvm.mlir.constant(dense<1.250000e-01> : vector<2xf64>) : vector<2xf64>
194 ! CHECK-LLVMIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
195 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
197 ! CHECK: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
198 ! CHECK: %[[carg:.*]] = sitofp <2 x i64> %[[arg1]] to <2 x double>
199 ! CHECK: %[[r:.*]] = fmul <2 x double> %[[carg]], <double 1.250000e-01, double 1.250000e-01>
200 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
201 end subroutine vec_ctf_test_i8i8
203 ! CHECK-LABEL: vec_ctf_test_u4i1
204 subroutine vec_ctf_test_u4i1(arg1)
205 vector(unsigned(4)), intent(in) :: arg1
206 vector(real(4)) :: r
207 r = vec_ctf(arg1, 1_1)
209 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
210 ! CHECK-FIR: %[[arg2:.*]] = arith.constant 1 : i8
211 ! CHECK-FIR: %[[carg2:.*]] = fir.convert %[[arg2]] : (i8) -> i32
212 ! CHECK-FIR: %[[r:.*]] = fir.call @llvm.ppc.altivec.vcfux(%[[arg1]], %[[carg2]]) fastmath<contract> : (!fir.vector<4:ui32>, i32) -> !fir.vector<4:f32>
213 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
215 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
216 ! CHECK-LLVMIR: %[[arg2:.*]] = llvm.mlir.constant(1 : i8) : i8
217 ! CHECK-LLVMIR: %[[carg2:.*]] = llvm.sext %[[arg2]] : i8 to i32
218 ! CHECK-LLVMIR: %[[r:.*]] = llvm.call @llvm.ppc.altivec.vcfux(%[[arg1]], %[[carg2]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<4xi32>, i32) -> vector<4xf32>
219 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
221 ! CHECK: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
222 ! CHECK: %[[r:.*]] = call contract <4 x float> @llvm.ppc.altivec.vcfux(<4 x i32> %[[arg1]], i32 1)
223 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
224 end subroutine vec_ctf_test_u4i1
226 ! CHECK-LABEL: vec_ctf_test_u4i2
227 subroutine vec_ctf_test_u4i2(arg1)
228 vector(unsigned(4)), intent(in) :: arg1
229 vector(real(4)) :: r
230 r = vec_ctf(arg1, 1_2)
232 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
233 ! CHECK-FIR: %[[arg2:.*]] = arith.constant 1 : i16
234 ! CHECK-FIR: %[[carg2:.*]] = fir.convert %[[arg2]] : (i16) -> i32
235 ! CHECK-FIR: %[[r:.*]] = fir.call @llvm.ppc.altivec.vcfux(%[[arg1]], %[[carg2]]) fastmath<contract> : (!fir.vector<4:ui32>, i32) -> !fir.vector<4:f32>
236 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
238 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
239 ! CHECK-LLVMIR: %[[arg2:.*]] = llvm.mlir.constant(1 : i16) : i16
240 ! CHECK-LLVMIR: %[[carg2:.*]] = llvm.sext %[[arg2]] : i16 to i32
241 ! CHECK-LLVMIR: %[[r:.*]] = llvm.call @llvm.ppc.altivec.vcfux(%[[arg1]], %[[carg2]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<4xi32>, i32) -> vector<4xf32>
242 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
244 ! CHECK: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
245 ! CHECK: %[[r:.*]] = call contract <4 x float> @llvm.ppc.altivec.vcfux(<4 x i32> %[[arg1]], i32 1)
246 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
247 end subroutine vec_ctf_test_u4i2
249 ! CHECK-LABEL: vec_ctf_test_u4i4
250 subroutine vec_ctf_test_u4i4(arg1)
251 vector(unsigned(4)), intent(in) :: arg1
252 vector(real(4)) :: r
253 r = vec_ctf(arg1, 1_4)
255 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
256 ! CHECK-FIR: %[[arg2:.*]] = arith.constant 1 : i32
257 ! CHECK-FIR: %[[r:.*]] = fir.call @llvm.ppc.altivec.vcfux(%[[arg1]], %[[arg2]]) fastmath<contract> : (!fir.vector<4:ui32>, i32) -> !fir.vector<4:f32>
258 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
260 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
261 ! CHECK-LLVMIR: %[[arg2:.*]] = llvm.mlir.constant(1 : i32) : i32
262 ! CHECK-LLVMIR: %[[r:.*]] = llvm.call @llvm.ppc.altivec.vcfux(%[[arg1]], %[[arg2]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<4xi32>, i32) -> vector<4xf32>
263 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
265 ! CHECK: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
266 ! CHECK: %[[r:.*]] = call contract <4 x float> @llvm.ppc.altivec.vcfux(<4 x i32> %[[arg1]], i32 1)
267 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
268 end subroutine vec_ctf_test_u4i4
270 ! CHECK-LABEL: vec_ctf_test_u4i8
271 subroutine vec_ctf_test_u4i8(arg1)
272 vector(unsigned(4)), intent(in) :: arg1
273 vector(real(4)) :: r
274 r = vec_ctf(arg1, 1_8)
276 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
277 ! CHECK-FIR: %[[arg2:.*]] = arith.constant 1 : i64
278 ! CHECK-FIR: %[[carg2:.*]] = fir.convert %[[arg2]] : (i64) -> i32
279 ! CHECK-FIR: %[[r:.*]] = fir.call @llvm.ppc.altivec.vcfux(%[[arg1]], %[[carg2]]) fastmath<contract> : (!fir.vector<4:ui32>, i32) -> !fir.vector<4:f32>
280 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
282 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
283 ! CHECK-LLVMIR: %[[arg2:.*]] = llvm.mlir.constant(1 : i64) : i64
284 ! CHECK-LLVMIR: %[[carg2:.*]] = llvm.trunc %[[arg2]] : i64 to i32
285 ! CHECK-LLVMIR: %[[r:.*]] = llvm.call @llvm.ppc.altivec.vcfux(%[[arg1]], %[[carg2]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<4xi32>, i32) -> vector<4xf32>
286 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
288 ! CHECK: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
289 ! CHECK: %[[r:.*]] = call contract <4 x float> @llvm.ppc.altivec.vcfux(<4 x i32> %[[arg1]], i32 1)
290 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
291 end subroutine vec_ctf_test_u4i8
293 ! CHECK-LABEL: vec_ctf_test_u8i1
294 subroutine vec_ctf_test_u8i1(arg1)
295 vector(unsigned(8)), intent(in) :: arg1
296 vector(real(8)) :: r
297 r = vec_ctf(arg1, 3_1)
299 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
300 ! CHECK-FIR: %[[varg:.*]] = fir.convert %[[arg1]] : (!fir.vector<2:ui64>) -> vector<2xi64>
301 ! CHECK-FIR: %[[carg:.*]] = llvm.uitofp %[[varg]] : vector<2xi64> to vector<2xf64>
302 ! CHECK-FIR: %[[cst:.*]] = arith.constant dense<1.250000e-01> : vector<2xf64>
303 ! CHECK-FIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
304 ! CHECK-FIR: %[[cr:.*]] = fir.convert %[[r]] : (vector<2xf64>) -> !fir.vector<2:f64>
305 ! CHECK-FIR: fir.store %[[cr]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
307 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
308 ! CHECK-LLVMIR: %[[carg:.*]] = llvm.uitofp %[[arg1]] : vector<2xi64> to vector<2xf64>
309 ! CHECK-LLVMIR: %[[cst:.*]] = llvm.mlir.constant(dense<1.250000e-01> : vector<2xf64>) : vector<2xf64>
310 ! CHECK-LLVMIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
311 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
313 ! CHECK: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
314 ! CHECK: %[[carg:.*]] = uitofp <2 x i64> %[[arg1]] to <2 x double>
315 ! CHECK: %[[r:.*]] = fmul <2 x double> %[[carg]], <double 1.250000e-01, double 1.250000e-01>
316 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
317 end subroutine vec_ctf_test_u8i1
319 ! CHECK-LABEL: vec_ctf_test_u8i2
320 subroutine vec_ctf_test_u8i2(arg1)
321 vector(unsigned(8)), intent(in) :: arg1
322 vector(real(8)) :: r
323 r = vec_ctf(arg1, 3_2)
325 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
326 ! CHECK-FIR: %[[varg:.*]] = fir.convert %[[arg1]] : (!fir.vector<2:ui64>) -> vector<2xi64>
327 ! CHECK-FIR: %[[carg:.*]] = llvm.uitofp %[[varg]] : vector<2xi64> to vector<2xf64>
328 ! CHECK-FIR: %[[cst:.*]] = arith.constant dense<1.250000e-01> : vector<2xf64>
329 ! CHECK-FIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
330 ! CHECK-FIR: %[[cr:.*]] = fir.convert %[[r]] : (vector<2xf64>) -> !fir.vector<2:f64>
331 ! CHECK-FIR: fir.store %[[cr]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
333 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
334 ! CHECK-LLVMIR: %[[carg:.*]] = llvm.uitofp %[[arg1]] : vector<2xi64> to vector<2xf64>
335 ! CHECK-LLVMIR: %[[cst:.*]] = llvm.mlir.constant(dense<1.250000e-01> : vector<2xf64>) : vector<2xf64>
336 ! CHECK-LLVMIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
337 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
339 ! CHECK: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
340 ! CHECK: %[[carg:.*]] = uitofp <2 x i64> %[[arg1]] to <2 x double>
341 ! CHECK: %[[r:.*]] = fmul <2 x double> %[[carg]], <double 1.250000e-01, double 1.250000e-01>
342 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
343 end subroutine vec_ctf_test_u8i2
345 ! CHECK-LABEL: vec_ctf_test_u8i4
346 subroutine vec_ctf_test_u8i4(arg1)
347 vector(unsigned(8)), intent(in) :: arg1
348 vector(real(8)) :: r
349 r = vec_ctf(arg1, 3_4)
351 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
352 ! CHECK-FIR: %[[varg:.*]] = fir.convert %[[arg1]] : (!fir.vector<2:ui64>) -> vector<2xi64>
353 ! CHECK-FIR: %[[carg:.*]] = llvm.uitofp %[[varg]] : vector<2xi64> to vector<2xf64>
354 ! CHECK-FIR: %[[cst:.*]] = arith.constant dense<1.250000e-01> : vector<2xf64>
355 ! CHECK-FIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
356 ! CHECK-FIR: %[[cr:.*]] = fir.convert %[[r]] : (vector<2xf64>) -> !fir.vector<2:f64>
357 ! CHECK-FIR: fir.store %[[cr]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
359 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
360 ! CHECK-LLVMIR: %[[carg:.*]] = llvm.uitofp %[[arg1]] : vector<2xi64> to vector<2xf64>
361 ! CHECK-LLVMIR: %[[cst:.*]] = llvm.mlir.constant(dense<1.250000e-01> : vector<2xf64>) : vector<2xf64>
362 ! CHECK-LLVMIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
363 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
365 ! CHECK: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
366 ! CHECK: %[[carg:.*]] = uitofp <2 x i64> %[[arg1]] to <2 x double>
367 ! CHECK: %[[r:.*]] = fmul <2 x double> %[[carg]], <double 1.250000e-01, double 1.250000e-01>
368 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
369 end subroutine vec_ctf_test_u8i4
371 ! CHECK-LABEL: vec_ctf_test_u8i8
372 subroutine vec_ctf_test_u8i8(arg1)
373 vector(unsigned(8)), intent(in) :: arg1
374 vector(real(8)) :: r
375 r = vec_ctf(arg1, 3_8)
377 ! CHECK-FIR: %[[arg1:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
378 ! CHECK-FIR: %[[varg:.*]] = fir.convert %[[arg1]] : (!fir.vector<2:ui64>) -> vector<2xi64>
379 ! CHECK-FIR: %[[carg:.*]] = llvm.uitofp %[[varg]] : vector<2xi64> to vector<2xf64>
380 ! CHECK-FIR: %[[cst:.*]] = arith.constant dense<1.250000e-01> : vector<2xf64>
381 ! CHECK-FIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
382 ! CHECK-FIR: %[[cr:.*]] = fir.convert %[[r]] : (vector<2xf64>) -> !fir.vector<2:f64>
383 ! CHECK-FIR: fir.store %[[cr]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
385 ! CHECK-LLVMIR: %[[arg1:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
386 ! CHECK-LLVMIR: %[[carg:.*]] = llvm.uitofp %[[arg1]] : vector<2xi64> to vector<2xf64>
387 ! CHECK-LLVMIR: %[[cst:.*]] = llvm.mlir.constant(dense<1.250000e-01> : vector<2xf64>) : vector<2xf64>
388 ! CHECK-LLVMIR: %[[r:.*]] = llvm.fmul %[[carg]], %[[cst]] : vector<2xf64>
389 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
391 ! CHECK: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
392 ! CHECK: %[[carg:.*]] = uitofp <2 x i64> %[[arg1]] to <2 x double>
393 ! CHECK: %[[r:.*]] = fmul <2 x double> %[[carg]], <double 1.250000e-01, double 1.250000e-01>
394 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
395 end subroutine vec_ctf_test_u8i8
397 !-------------
398 ! vec_convert
399 !-------------
400 ! CHECK-LABEL: vec_convert_test_i1i1
401 subroutine vec_convert_test_i1i1(v, mold)
402 vector(integer(1)) :: v
403 vector(integer(1)) :: mold, r
404 r = vec_convert(v, mold)
406 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
407 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
408 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<16xi8>
409 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
410 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
412 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
413 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<16xi8>>
415 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
416 ! CHECK: store <16 x i8> %[[v]], ptr %{{.*}}, align 16
417 end subroutine vec_convert_test_i1i1
419 ! CHECK-LABEL: vec_convert_test_i1i2
420 subroutine vec_convert_test_i1i2(v, mold)
421 vector(integer(1)) :: v
422 vector(integer(2)) :: mold, r
423 r = vec_convert(v, mold)
425 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
426 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
427 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<8xi16>
428 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
429 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
431 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
432 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<8xi16>
433 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
435 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
436 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <8 x i16>
437 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
438 end subroutine vec_convert_test_i1i2
440 ! CHECK-LABEL: vec_convert_test_i1i4
441 subroutine vec_convert_test_i1i4(v, mold)
442 vector(integer(1)) :: v
443 vector(integer(4)) :: mold, r
444 r = vec_convert(v, mold)
446 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
447 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
448 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<4xi32>
449 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
450 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
452 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
453 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<4xi32>
454 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
456 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
457 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <4 x i32>
458 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
459 end subroutine vec_convert_test_i1i4
461 ! CHECK-LABEL: vec_convert_test_i1i8
462 subroutine vec_convert_test_i1i8(v, mold)
463 vector(integer(1)) :: v
464 vector(integer(8)) :: mold, r
465 r = vec_convert(v, mold)
467 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
468 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
469 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<2xi64>
470 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
471 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
473 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
474 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<2xi64>
475 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
477 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
478 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <2 x i64>
479 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
480 end subroutine vec_convert_test_i1i8
482 ! CHECK-LABEL: vec_convert_test_i1u1
483 subroutine vec_convert_test_i1u1(v, mold)
484 vector(integer(1)) :: v
485 vector(unsigned(1)) :: mold, r
486 r = vec_convert(v, mold)
488 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
489 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
490 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<16xi8>
491 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
492 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
494 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
495 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<16xi8>>
497 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
498 ! CHECK: store <16 x i8> %[[v]], ptr %{{.*}}, align 16
499 end subroutine vec_convert_test_i1u1
501 ! CHECK-LABEL: vec_convert_test_i1u2
502 subroutine vec_convert_test_i1u2(v, mold)
503 vector(integer(1)) :: v
504 vector(unsigned(2)) :: mold, r
505 r = vec_convert(v, mold)
507 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
508 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
509 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<8xi16>
510 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
511 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
513 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
514 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<8xi16>
515 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
517 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
518 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <8 x i16>
519 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
520 end subroutine vec_convert_test_i1u2
522 ! CHECK-LABEL: vec_convert_test_i1u4
523 subroutine vec_convert_test_i1u4(v, mold)
524 vector(integer(1)) :: v
525 vector(unsigned(4)) :: mold, r
526 r = vec_convert(v, mold)
528 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
529 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
530 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<4xi32>
531 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
532 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
534 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
535 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<4xi32>
536 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
538 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
539 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <4 x i32>
540 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
541 end subroutine vec_convert_test_i1u4
543 ! CHECK-LABEL: vec_convert_test_i1u8
544 subroutine vec_convert_test_i1u8(v, mold)
545 vector(integer(1)) :: v
546 vector(unsigned(8)) :: mold, r
547 r = vec_convert(v, mold)
549 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
550 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
551 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<2xi64>
552 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
553 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
555 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
556 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<2xi64>
557 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
559 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
560 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <2 x i64>
561 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
562 end subroutine vec_convert_test_i1u8
564 ! CHECK-LABEL: vec_convert_test_i1r4
565 subroutine vec_convert_test_i1r4(v, mold)
566 vector(integer(1)) :: v
567 vector(real(4)) :: mold, r
568 r = vec_convert(v, mold)
570 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
571 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
572 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<4xf32>
573 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
574 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
576 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
577 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<4xf32>
578 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
580 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
581 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <4 x float>
582 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
583 end subroutine vec_convert_test_i1r4
585 ! CHECK-LABEL: vec_convert_test_i1r8
586 subroutine vec_convert_test_i1r8(v, mold)
587 vector(integer(1)) :: v
588 vector(real(8)) :: mold, r
589 r = vec_convert(v, mold)
591 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
592 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
593 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<2xf64>
594 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
595 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
597 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
598 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<2xf64>
599 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
601 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
602 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <2 x double>
603 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
604 end subroutine vec_convert_test_i1r8
606 ! CHECK-LABEL: vec_convert_test_i2i1
607 subroutine vec_convert_test_i2i1(v, mold)
608 vector(integer(2)) :: v
609 vector(integer(1)) :: mold, r
610 r = vec_convert(v, mold)
612 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
613 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
614 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<16xi8>
615 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
616 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
618 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
619 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<16xi8>
620 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
622 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
623 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <16 x i8>
624 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
625 end subroutine vec_convert_test_i2i1
627 ! CHECK-LABEL: vec_convert_test_i2i2
628 subroutine vec_convert_test_i2i2(v, mold)
629 vector(integer(2)) :: v
630 vector(integer(2)) :: mold, r
631 r = vec_convert(v, mold)
633 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
634 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
635 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<8xi16>
636 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
637 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
639 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
640 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<8xi16>>
642 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
643 ! CHECK: store <8 x i16> %[[v]], ptr %{{.*}}, align 16
644 end subroutine vec_convert_test_i2i2
646 ! CHECK-LABEL: vec_convert_test_i2i4
647 subroutine vec_convert_test_i2i4(v, mold)
648 vector(integer(2)) :: v
649 vector(integer(4)) :: mold, r
650 r = vec_convert(v, mold)
652 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
653 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
654 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<4xi32>
655 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
656 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
658 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
659 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<4xi32>
660 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
662 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
663 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <4 x i32>
664 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
665 end subroutine vec_convert_test_i2i4
667 ! CHECK-LABEL: vec_convert_test_i2i8
668 subroutine vec_convert_test_i2i8(v, mold)
669 vector(integer(2)) :: v
670 vector(integer(8)) :: mold, r
671 r = vec_convert(v, mold)
673 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
674 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
675 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<2xi64>
676 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
677 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
679 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
680 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<2xi64>
681 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
683 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
684 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <2 x i64>
685 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
686 end subroutine vec_convert_test_i2i8
688 ! CHECK-LABEL: vec_convert_test_i2u1
689 subroutine vec_convert_test_i2u1(v, mold)
690 vector(integer(2)) :: v
691 vector(unsigned(1)) :: mold, r
692 r = vec_convert(v, mold)
694 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
695 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
696 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<16xi8>
697 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
698 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
700 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
701 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<16xi8>
702 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
704 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
705 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <16 x i8>
706 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
707 end subroutine vec_convert_test_i2u1
709 ! CHECK-LABEL: vec_convert_test_i2u2
710 subroutine vec_convert_test_i2u2(v, mold)
711 vector(integer(2)) :: v
712 vector(unsigned(2)) :: mold, r
713 r = vec_convert(v, mold)
715 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
716 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
717 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<8xi16>
718 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
719 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
721 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
722 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<8xi16>>
724 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
725 ! CHECK: store <8 x i16> %[[v]], ptr %{{.*}}, align 16
726 end subroutine vec_convert_test_i2u2
728 ! CHECK-LABEL: vec_convert_test_i2u4
729 subroutine vec_convert_test_i2u4(v, mold)
730 vector(integer(2)) :: v
731 vector(unsigned(4)) :: mold, r
732 r = vec_convert(v, mold)
734 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
735 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
736 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<4xi32>
737 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
738 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
740 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
741 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<4xi32>
742 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
744 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
745 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <4 x i32>
746 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
747 end subroutine vec_convert_test_i2u4
749 ! CHECK-LABEL: vec_convert_test_i2u8
750 subroutine vec_convert_test_i2u8(v, mold)
751 vector(integer(2)) :: v
752 vector(unsigned(8)) :: mold, r
753 r = vec_convert(v, mold)
755 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
756 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
757 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<2xi64>
758 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
759 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
761 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
762 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<2xi64>
763 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
765 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
766 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <2 x i64>
767 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
768 end subroutine vec_convert_test_i2u8
770 ! CHECK-LABEL: vec_convert_test_i2r4
771 subroutine vec_convert_test_i2r4(v, mold)
772 vector(integer(2)) :: v
773 vector(real(4)) :: mold, r
774 r = vec_convert(v, mold)
776 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
777 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
778 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<4xf32>
779 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
780 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
782 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
783 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<4xf32>
784 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
786 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
787 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <4 x float>
788 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
789 end subroutine vec_convert_test_i2r4
791 ! CHECK-LABEL: vec_convert_test_i2r8
792 subroutine vec_convert_test_i2r8(v, mold)
793 vector(integer(2)) :: v
794 vector(real(8)) :: mold, r
795 r = vec_convert(v, mold)
797 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:i16>>
798 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:i16>) -> vector<8xi16>
799 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<2xf64>
800 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
801 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
803 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
804 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<2xf64>
805 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
807 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
808 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <2 x double>
809 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
810 end subroutine vec_convert_test_i2r8
812 ! CHECK-LABEL: vec_convert_test_i4i1
813 subroutine vec_convert_test_i4i1(v, mold)
814 vector(integer(4)) :: v
815 vector(integer(1)) :: mold, r
816 r = vec_convert(v, mold)
818 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
819 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
820 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<16xi8>
821 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
822 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
824 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
825 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<16xi8>
826 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
828 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
829 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <16 x i8>
830 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
831 end subroutine vec_convert_test_i4i1
833 ! CHECK-LABEL: vec_convert_test_i4i2
834 subroutine vec_convert_test_i4i2(v, mold)
835 vector(integer(4)) :: v
836 vector(integer(2)) :: mold, r
837 r = vec_convert(v, mold)
839 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
840 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
841 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<8xi16>
842 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
843 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
845 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
846 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<8xi16>
847 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
849 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
850 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <8 x i16>
851 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
852 end subroutine vec_convert_test_i4i2
854 ! CHECK-LABEL: vec_convert_test_i4i4
855 subroutine vec_convert_test_i4i4(v, mold)
856 vector(integer(4)) :: v
857 vector(integer(4)) :: mold, r
858 r = vec_convert(v, mold)
860 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
861 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
862 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<4xi32>
863 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
864 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
866 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
867 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<4xi32>>
869 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
870 ! CHECK: store <4 x i32> %[[v]], ptr %{{.*}}, align 16
871 end subroutine vec_convert_test_i4i4
873 ! CHECK-LABEL: vec_convert_test_i4i8
874 subroutine vec_convert_test_i4i8(v, mold)
875 vector(integer(4)) :: v
876 vector(integer(8)) :: mold, r
877 r = vec_convert(v, mold)
879 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
880 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
881 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<2xi64>
882 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
883 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
885 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
886 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<2xi64>
887 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
889 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
890 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <2 x i64>
891 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
892 end subroutine vec_convert_test_i4i8
894 ! CHECK-LABEL: vec_convert_test_i4u1
895 subroutine vec_convert_test_i4u1(v, mold)
896 vector(integer(4)) :: v
897 vector(unsigned(1)) :: mold, r
898 r = vec_convert(v, mold)
900 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
901 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
902 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<16xi8>
903 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
904 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
906 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
907 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<16xi8>
908 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
910 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
911 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <16 x i8>
912 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
913 end subroutine vec_convert_test_i4u1
915 ! CHECK-LABEL: vec_convert_test_i4u2
916 subroutine vec_convert_test_i4u2(v, mold)
917 vector(integer(4)) :: v
918 vector(unsigned(2)) :: mold, r
919 r = vec_convert(v, mold)
921 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
922 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
923 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<8xi16>
924 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
925 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
927 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
928 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<8xi16>
929 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
931 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
932 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <8 x i16>
933 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
934 end subroutine vec_convert_test_i4u2
936 ! CHECK-LABEL: vec_convert_test_i4u4
937 subroutine vec_convert_test_i4u4(v, mold)
938 vector(integer(4)) :: v
939 vector(unsigned(4)) :: mold, r
940 r = vec_convert(v, mold)
942 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
943 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
944 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<4xi32>
945 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
946 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
948 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
949 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<4xi32>>
951 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
952 ! CHECK: store <4 x i32> %[[v]], ptr %{{.*}}, align 16
953 end subroutine vec_convert_test_i4u4
955 ! CHECK-LABEL: vec_convert_test_i4u8
956 subroutine vec_convert_test_i4u8(v, mold)
957 vector(integer(4)) :: v
958 vector(unsigned(8)) :: mold, r
959 r = vec_convert(v, mold)
961 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
962 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
963 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<2xi64>
964 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
965 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
967 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
968 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<2xi64>
969 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
971 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
972 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <2 x i64>
973 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
974 end subroutine vec_convert_test_i4u8
976 ! CHECK-LABEL: vec_convert_test_i4r4
977 subroutine vec_convert_test_i4r4(v, mold)
978 vector(integer(4)) :: v
979 vector(real(4)) :: mold, r
980 r = vec_convert(v, mold)
982 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
983 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
984 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<4xf32>
985 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
986 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
988 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
989 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<4xf32>
990 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
992 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
993 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <4 x float>
994 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
995 end subroutine vec_convert_test_i4r4
997 ! CHECK-LABEL: vec_convert_test_i4r8
998 subroutine vec_convert_test_i4r8(v, mold)
999 vector(integer(4)) :: v
1000 vector(real(8)) :: mold, r
1001 r = vec_convert(v, mold)
1003 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
1004 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
1005 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<2xf64>
1006 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
1007 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
1009 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1010 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<2xf64>
1011 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
1013 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1014 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <2 x double>
1015 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
1016 end subroutine vec_convert_test_i4r8
1018 ! CHECK-LABEL: vec_convert_test_i8i1
1019 subroutine vec_convert_test_i8i1(v, mold)
1020 vector(integer(8)) :: v
1021 vector(integer(1)) :: mold, r
1022 r = vec_convert(v, mold)
1024 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1025 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1026 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<16xi8>
1027 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
1028 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
1030 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1031 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<16xi8>
1032 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1034 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1035 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <16 x i8>
1036 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
1037 end subroutine vec_convert_test_i8i1
1039 ! CHECK-LABEL: vec_convert_test_i8i2
1040 subroutine vec_convert_test_i8i2(v, mold)
1041 vector(integer(8)) :: v
1042 vector(integer(2)) :: mold, r
1043 r = vec_convert(v, mold)
1045 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1046 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1047 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<8xi16>
1048 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
1049 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
1051 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1052 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<8xi16>
1053 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1055 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1056 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <8 x i16>
1057 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
1058 end subroutine vec_convert_test_i8i2
1060 ! CHECK-LABEL: vec_convert_test_i8i4
1061 subroutine vec_convert_test_i8i4(v, mold)
1062 vector(integer(8)) :: v
1063 vector(integer(4)) :: mold, r
1064 r = vec_convert(v, mold)
1066 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1067 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1068 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<4xi32>
1069 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
1070 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
1072 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1073 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<4xi32>
1074 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1076 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1077 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <4 x i32>
1078 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
1079 end subroutine vec_convert_test_i8i4
1081 ! CHECK-LABEL: vec_convert_test_i8i8
1082 subroutine vec_convert_test_i8i8(v, mold)
1083 vector(integer(8)) :: v
1084 vector(integer(8)) :: mold, r
1085 r = vec_convert(v, mold)
1087 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1088 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1089 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<2xi64>
1090 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
1091 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1093 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1094 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<2xi64>>
1096 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1097 ! CHECK: store <2 x i64> %[[v]], ptr %{{.*}}, align 16
1098 end subroutine vec_convert_test_i8i8
1100 ! CHECK-LABEL: vec_convert_test_i8u1
1101 subroutine vec_convert_test_i8u1(v, mold)
1102 vector(integer(8)) :: v
1103 vector(unsigned(1)) :: mold, r
1104 r = vec_convert(v, mold)
1106 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1107 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1108 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<16xi8>
1109 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
1110 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1112 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1113 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<16xi8>
1114 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1116 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1117 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <16 x i8>
1118 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
1119 end subroutine vec_convert_test_i8u1
1121 ! CHECK-LABEL: vec_convert_test_i8u2
1122 subroutine vec_convert_test_i8u2(v, mold)
1123 vector(integer(8)) :: v
1124 vector(unsigned(2)) :: mold, r
1125 r = vec_convert(v, mold)
1127 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1128 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1129 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<8xi16>
1130 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
1131 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1133 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1134 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<8xi16>
1135 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1137 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1138 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <8 x i16>
1139 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
1140 end subroutine vec_convert_test_i8u2
1142 ! CHECK-LABEL: vec_convert_test_i8u4
1143 subroutine vec_convert_test_i8u4(v, mold)
1144 vector(integer(8)) :: v
1145 vector(unsigned(4)) :: mold, r
1146 r = vec_convert(v, mold)
1148 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1149 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1150 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<4xi32>
1151 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
1152 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1154 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1155 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<4xi32>
1156 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1158 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1159 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <4 x i32>
1160 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
1161 end subroutine vec_convert_test_i8u4
1163 ! CHECK-LABEL: vec_convert_test_i8u8
1164 subroutine vec_convert_test_i8u8(v, mold)
1165 vector(integer(8)) :: v
1166 vector(unsigned(8)) :: mold, r
1167 r = vec_convert(v, mold)
1169 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1170 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1171 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<2xi64>
1172 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
1173 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1175 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1176 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<2xi64>>
1178 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1179 ! CHECK: store <2 x i64> %[[v]], ptr %{{.*}}, align 16
1180 end subroutine vec_convert_test_i8u8
1182 ! CHECK-LABEL: vec_convert_test_i8r4
1183 subroutine vec_convert_test_i8r4(v, mold)
1184 vector(integer(8)) :: v
1185 vector(real(4)) :: mold, r
1186 r = vec_convert(v, mold)
1188 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1189 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1190 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<4xf32>
1191 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
1192 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
1194 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1195 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<4xf32>
1196 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
1198 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1199 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <4 x float>
1200 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
1201 end subroutine vec_convert_test_i8r4
1203 ! CHECK-LABEL: vec_convert_test_i8r8
1204 subroutine vec_convert_test_i8r8(v, mold)
1205 vector(integer(8)) :: v
1206 vector(real(8)) :: mold, r
1207 r = vec_convert(v, mold)
1209 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1210 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:i64>) -> vector<2xi64>
1211 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<2xf64>
1212 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
1213 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
1215 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1216 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<2xf64>
1217 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
1219 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1220 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <2 x double>
1221 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
1222 end subroutine vec_convert_test_i8r8
1224 ! CHECK-LABEL: vec_convert_test_u1i1
1225 subroutine vec_convert_test_u1i1(v, mold)
1226 vector(unsigned(1)) :: v
1227 vector(integer(1)) :: mold, r
1228 r = vec_convert(v, mold)
1230 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1231 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1232 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<16xi8>
1233 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
1234 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
1236 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1237 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1239 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1240 ! CHECK: store <16 x i8> %[[v]], ptr %{{.*}}, align 16
1241 end subroutine vec_convert_test_u1i1
1243 ! CHECK-LABEL: vec_convert_test_u1i2
1244 subroutine vec_convert_test_u1i2(v, mold)
1245 vector(unsigned(1)) :: v
1246 vector(integer(2)) :: mold, r
1247 r = vec_convert(v, mold)
1249 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1250 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1251 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<8xi16>
1252 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
1253 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
1255 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1256 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<8xi16>
1257 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1259 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1260 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <8 x i16>
1261 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
1262 end subroutine vec_convert_test_u1i2
1264 ! CHECK-LABEL: vec_convert_test_u1i4
1265 subroutine vec_convert_test_u1i4(v, mold)
1266 vector(unsigned(1)) :: v
1267 vector(integer(4)) :: mold, r
1268 r = vec_convert(v, mold)
1270 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1271 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1272 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<4xi32>
1273 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
1274 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
1276 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1277 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<4xi32>
1278 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1280 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1281 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <4 x i32>
1282 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
1283 end subroutine vec_convert_test_u1i4
1285 ! CHECK-LABEL: vec_convert_test_u1i8
1286 subroutine vec_convert_test_u1i8(v, mold)
1287 vector(unsigned(1)) :: v
1288 vector(integer(8)) :: mold, r
1289 r = vec_convert(v, mold)
1291 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1292 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1293 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<2xi64>
1294 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
1295 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1297 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1298 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<2xi64>
1299 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
1301 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1302 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <2 x i64>
1303 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
1304 end subroutine vec_convert_test_u1i8
1306 ! CHECK-LABEL: vec_convert_test_u1u1
1307 subroutine vec_convert_test_u1u1(v, mold)
1308 vector(unsigned(1)) :: v
1309 vector(unsigned(1)) :: mold, r
1310 r = vec_convert(v, mold)
1312 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1313 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1314 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<16xi8>
1315 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
1316 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1318 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1319 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1321 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1322 ! CHECK: store <16 x i8> %[[v]], ptr %{{.*}}, align 16
1323 end subroutine vec_convert_test_u1u1
1325 ! CHECK-LABEL: vec_convert_test_u1u2
1326 subroutine vec_convert_test_u1u2(v, mold)
1327 vector(unsigned(1)) :: v
1328 vector(unsigned(2)) :: mold, r
1329 r = vec_convert(v, mold)
1331 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1332 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1333 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<8xi16>
1334 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
1335 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1337 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1338 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<8xi16>
1339 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1341 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1342 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <8 x i16>
1343 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
1344 end subroutine vec_convert_test_u1u2
1346 ! CHECK-LABEL: vec_convert_test_u1u4
1347 subroutine vec_convert_test_u1u4(v, mold)
1348 vector(unsigned(1)) :: v
1349 vector(unsigned(4)) :: mold, r
1350 r = vec_convert(v, mold)
1352 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1353 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1354 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<4xi32>
1355 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
1356 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1358 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1359 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<4xi32>
1360 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1362 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1363 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <4 x i32>
1364 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
1365 end subroutine vec_convert_test_u1u4
1367 ! CHECK-LABEL: vec_convert_test_u1u8
1368 subroutine vec_convert_test_u1u8(v, mold)
1369 vector(unsigned(1)) :: v
1370 vector(unsigned(8)) :: mold, r
1371 r = vec_convert(v, mold)
1373 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1374 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1375 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<2xi64>
1376 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
1377 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1379 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1380 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<2xi64>
1381 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
1383 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1384 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <2 x i64>
1385 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
1386 end subroutine vec_convert_test_u1u8
1388 ! CHECK-LABEL: vec_convert_test_u1r4
1389 subroutine vec_convert_test_u1r4(v, mold)
1390 vector(unsigned(1)) :: v
1391 vector(real(4)) :: mold, r
1392 r = vec_convert(v, mold)
1394 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1395 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1396 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<4xf32>
1397 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
1398 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
1400 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1401 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<4xf32>
1402 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
1404 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1405 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <4 x float>
1406 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
1407 end subroutine vec_convert_test_u1r4
1409 ! CHECK-LABEL: vec_convert_test_u1r8
1410 subroutine vec_convert_test_u1r8(v, mold)
1411 vector(unsigned(1)) :: v
1412 vector(real(8)) :: mold, r
1413 r = vec_convert(v, mold)
1415 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1416 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<16:ui8>) -> vector<16xi8>
1417 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<16xi8> to vector<2xf64>
1418 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
1419 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
1421 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
1422 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<16xi8> to vector<2xf64>
1423 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
1425 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %0, align 16
1426 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[v]] to <2 x double>
1427 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
1428 end subroutine vec_convert_test_u1r8
1430 ! CHECK-LABEL: vec_convert_test_u2i1
1431 subroutine vec_convert_test_u2i1(v, mold)
1432 vector(unsigned(2)) :: v
1433 vector(integer(1)) :: mold, r
1434 r = vec_convert(v, mold)
1436 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1437 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1438 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<16xi8>
1439 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
1440 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
1442 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1443 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<16xi8>
1444 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1446 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1447 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <16 x i8>
1448 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
1449 end subroutine vec_convert_test_u2i1
1451 ! CHECK-LABEL: vec_convert_test_u2i2
1452 subroutine vec_convert_test_u2i2(v, mold)
1453 vector(unsigned(2)) :: v
1454 vector(integer(2)) :: mold, r
1455 r = vec_convert(v, mold)
1457 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1458 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1459 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<8xi16>
1460 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
1461 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
1463 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1464 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1466 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1467 ! CHECK: store <8 x i16> %[[v]], ptr %{{.*}}, align 16
1468 end subroutine vec_convert_test_u2i2
1470 ! CHECK-LABEL: vec_convert_test_u2i4
1471 subroutine vec_convert_test_u2i4(v, mold)
1472 vector(unsigned(2)) :: v
1473 vector(integer(4)) :: mold, r
1474 r = vec_convert(v, mold)
1476 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1477 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1478 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<4xi32>
1479 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
1480 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
1482 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1483 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<4xi32>
1484 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1486 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1487 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <4 x i32>
1488 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
1489 end subroutine vec_convert_test_u2i4
1491 ! CHECK-LABEL: vec_convert_test_u2i8
1492 subroutine vec_convert_test_u2i8(v, mold)
1493 vector(unsigned(2)) :: v
1494 vector(integer(8)) :: mold, r
1495 r = vec_convert(v, mold)
1497 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1498 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1499 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<2xi64>
1500 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
1501 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1503 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1504 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<2xi64>
1505 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
1507 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1508 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <2 x i64>
1509 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
1510 end subroutine vec_convert_test_u2i8
1512 ! CHECK-LABEL: vec_convert_test_u2u1
1513 subroutine vec_convert_test_u2u1(v, mold)
1514 vector(unsigned(2)) :: v
1515 vector(unsigned(1)) :: mold, r
1516 r = vec_convert(v, mold)
1518 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1519 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1520 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<16xi8>
1521 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
1522 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1524 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1525 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<16xi8>
1526 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1528 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1529 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <16 x i8>
1530 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
1531 end subroutine vec_convert_test_u2u1
1533 ! CHECK-LABEL: vec_convert_test_u2u2
1534 subroutine vec_convert_test_u2u2(v, mold)
1535 vector(unsigned(2)) :: v
1536 vector(unsigned(2)) :: mold, r
1537 r = vec_convert(v, mold)
1539 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1540 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1541 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<8xi16>
1542 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
1543 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1545 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1546 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1548 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1549 ! CHECK: store <8 x i16> %[[v]], ptr %{{.*}}, align 16
1550 end subroutine vec_convert_test_u2u2
1552 ! CHECK-LABEL: vec_convert_test_u2u4
1553 subroutine vec_convert_test_u2u4(v, mold)
1554 vector(unsigned(2)) :: v
1555 vector(unsigned(4)) :: mold, r
1556 r = vec_convert(v, mold)
1558 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1559 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1560 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<4xi32>
1561 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
1562 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1564 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1565 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<4xi32>
1566 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1568 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1569 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <4 x i32>
1570 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
1571 end subroutine vec_convert_test_u2u4
1573 ! CHECK-LABEL: vec_convert_test_u2u8
1574 subroutine vec_convert_test_u2u8(v, mold)
1575 vector(unsigned(2)) :: v
1576 vector(unsigned(8)) :: mold, r
1577 r = vec_convert(v, mold)
1579 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1580 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1581 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<2xi64>
1582 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
1583 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1585 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1586 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<2xi64>
1587 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
1589 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1590 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <2 x i64>
1591 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
1592 end subroutine vec_convert_test_u2u8
1594 ! CHECK-LABEL: vec_convert_test_u2r4
1595 subroutine vec_convert_test_u2r4(v, mold)
1596 vector(unsigned(2)) :: v
1597 vector(real(4)) :: mold, r
1598 r = vec_convert(v, mold)
1600 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1601 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1602 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<4xf32>
1603 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
1604 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
1606 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1607 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<4xf32>
1608 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
1610 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1611 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <4 x float>
1612 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
1613 end subroutine vec_convert_test_u2r4
1615 ! CHECK-LABEL: vec_convert_test_u2r8
1616 subroutine vec_convert_test_u2r8(v, mold)
1617 vector(unsigned(2)) :: v
1618 vector(real(8)) :: mold, r
1619 r = vec_convert(v, mold)
1621 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1622 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<8:ui16>) -> vector<8xi16>
1623 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<8xi16> to vector<2xf64>
1624 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
1625 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
1627 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<8xi16>>
1628 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<8xi16> to vector<2xf64>
1629 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
1631 ! CHECK: %[[v:.*]] = load <8 x i16>, ptr %0, align 16
1632 ! CHECK: %[[r:.*]] = bitcast <8 x i16> %[[v]] to <2 x double>
1633 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
1634 end subroutine vec_convert_test_u2r8
1636 ! CHECK-LABEL: vec_convert_test_u4i1
1637 subroutine vec_convert_test_u4i1(v, mold)
1638 vector(unsigned(4)) :: v
1639 vector(integer(1)) :: mold, r
1640 r = vec_convert(v, mold)
1642 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1643 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1644 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<16xi8>
1645 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
1646 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
1648 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1649 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<16xi8>
1650 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1652 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1653 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <16 x i8>
1654 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
1655 end subroutine vec_convert_test_u4i1
1657 ! CHECK-LABEL: vec_convert_test_u4i2
1658 subroutine vec_convert_test_u4i2(v, mold)
1659 vector(unsigned(4)) :: v
1660 vector(integer(2)) :: mold, r
1661 r = vec_convert(v, mold)
1663 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1664 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1665 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<8xi16>
1666 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
1667 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
1669 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1670 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<8xi16>
1671 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1673 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1674 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <8 x i16>
1675 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
1676 end subroutine vec_convert_test_u4i2
1678 ! CHECK-LABEL: vec_convert_test_u4i4
1679 subroutine vec_convert_test_u4i4(v, mold)
1680 vector(unsigned(4)) :: v
1681 vector(integer(4)) :: mold, r
1682 r = vec_convert(v, mold)
1684 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1685 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1686 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<4xi32>
1687 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
1688 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
1690 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1691 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1693 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1694 ! CHECK: store <4 x i32> %[[v]], ptr %{{.*}}, align 16
1695 end subroutine vec_convert_test_u4i4
1697 ! CHECK-LABEL: vec_convert_test_u4i8
1698 subroutine vec_convert_test_u4i8(v, mold)
1699 vector(unsigned(4)) :: v
1700 vector(integer(8)) :: mold, r
1701 r = vec_convert(v, mold)
1703 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1704 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1705 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<2xi64>
1706 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
1707 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1709 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1710 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<2xi64>
1711 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
1713 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1714 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <2 x i64>
1715 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
1716 end subroutine vec_convert_test_u4i8
1718 ! CHECK-LABEL: vec_convert_test_u4u1
1719 subroutine vec_convert_test_u4u1(v, mold)
1720 vector(unsigned(4)) :: v
1721 vector(unsigned(1)) :: mold, r
1722 r = vec_convert(v, mold)
1724 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1725 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1726 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<16xi8>
1727 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
1728 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1730 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1731 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<16xi8>
1732 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1734 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1735 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <16 x i8>
1736 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
1737 end subroutine vec_convert_test_u4u1
1739 ! CHECK-LABEL: vec_convert_test_u4u2
1740 subroutine vec_convert_test_u4u2(v, mold)
1741 vector(unsigned(4)) :: v
1742 vector(unsigned(2)) :: mold, r
1743 r = vec_convert(v, mold)
1745 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1746 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1747 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<8xi16>
1748 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
1749 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1751 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1752 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<8xi16>
1753 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1755 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1756 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <8 x i16>
1757 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
1758 end subroutine vec_convert_test_u4u2
1760 ! CHECK-LABEL: vec_convert_test_u4u4
1761 subroutine vec_convert_test_u4u4(v, mold)
1762 vector(unsigned(4)) :: v
1763 vector(unsigned(4)) :: mold, r
1764 r = vec_convert(v, mold)
1766 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1767 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1768 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<4xi32>
1769 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
1770 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1772 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1773 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1775 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1776 ! CHECK: store <4 x i32> %[[v]], ptr %{{.*}}, align 16
1777 end subroutine vec_convert_test_u4u4
1779 ! CHECK-LABEL: vec_convert_test_u4u8
1780 subroutine vec_convert_test_u4u8(v, mold)
1781 vector(unsigned(4)) :: v
1782 vector(unsigned(8)) :: mold, r
1783 r = vec_convert(v, mold)
1785 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1786 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1787 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<2xi64>
1788 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
1789 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1791 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1792 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<2xi64>
1793 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
1795 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1796 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <2 x i64>
1797 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
1798 end subroutine vec_convert_test_u4u8
1800 ! CHECK-LABEL: vec_convert_test_u4r4
1801 subroutine vec_convert_test_u4r4(v, mold)
1802 vector(unsigned(4)) :: v
1803 vector(real(4)) :: mold, r
1804 r = vec_convert(v, mold)
1806 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1807 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1808 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<4xf32>
1809 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
1810 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
1812 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1813 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<4xf32>
1814 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
1816 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1817 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <4 x float>
1818 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
1819 end subroutine vec_convert_test_u4r4
1821 ! CHECK-LABEL: vec_convert_test_u4r8
1822 subroutine vec_convert_test_u4r8(v, mold)
1823 vector(unsigned(4)) :: v
1824 vector(real(8)) :: mold, r
1825 r = vec_convert(v, mold)
1827 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1828 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:ui32>) -> vector<4xi32>
1829 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xi32> to vector<2xf64>
1830 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
1831 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
1833 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
1834 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<2xf64>
1835 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
1837 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %0, align 16
1838 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <2 x double>
1839 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
1840 end subroutine vec_convert_test_u4r8
1842 ! CHECK-LABEL: vec_convert_test_u8i1
1843 subroutine vec_convert_test_u8i1(v, mold)
1844 vector(unsigned(8)) :: v
1845 vector(integer(1)) :: mold, r
1846 r = vec_convert(v, mold)
1848 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1849 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
1850 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<16xi8>
1851 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
1852 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
1854 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1855 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<16xi8>
1856 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1858 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1859 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <16 x i8>
1860 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
1861 end subroutine vec_convert_test_u8i1
1863 ! CHECK-LABEL: vec_convert_test_u8i2
1864 subroutine vec_convert_test_u8i2(v, mold)
1865 vector(unsigned(8)) :: v
1866 vector(integer(2)) :: mold, r
1867 r = vec_convert(v, mold)
1869 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1870 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
1871 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<8xi16>
1872 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
1873 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
1875 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1876 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<8xi16>
1877 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1879 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1880 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <8 x i16>
1881 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
1882 end subroutine vec_convert_test_u8i2
1884 ! CHECK-LABEL: vec_convert_test_u8i4
1885 subroutine vec_convert_test_u8i4(v, mold)
1886 vector(unsigned(8)) :: v
1887 vector(integer(4)) :: mold, r
1888 r = vec_convert(v, mold)
1890 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1891 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
1892 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<4xi32>
1893 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
1894 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
1896 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1897 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<4xi32>
1898 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1900 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1901 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <4 x i32>
1902 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
1903 end subroutine vec_convert_test_u8i4
1905 ! CHECK-LABEL: vec_convert_test_u8i8
1906 subroutine vec_convert_test_u8i8(v, mold)
1907 vector(unsigned(8)) :: v
1908 vector(integer(8)) :: mold, r
1909 r = vec_convert(v, mold)
1911 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1912 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
1913 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<2xi64>
1914 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
1915 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
1917 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1918 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<2xi64>>
1920 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1921 ! CHECK: store <2 x i64> %[[v]], ptr %{{.*}}, align 16
1922 end subroutine vec_convert_test_u8i8
1924 ! CHECK-LABEL: vec_convert_test_u8u1
1925 subroutine vec_convert_test_u8u1(v, mold)
1926 vector(unsigned(8)) :: v
1927 vector(unsigned(1)) :: mold, r
1928 r = vec_convert(v, mold)
1930 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1931 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
1932 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<16xi8>
1933 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
1934 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
1936 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1937 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<16xi8>
1938 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
1940 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1941 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <16 x i8>
1942 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
1943 end subroutine vec_convert_test_u8u1
1945 ! CHECK-LABEL: vec_convert_test_u8u2
1946 subroutine vec_convert_test_u8u2(v, mold)
1947 vector(unsigned(8)) :: v
1948 vector(unsigned(2)) :: mold, r
1949 r = vec_convert(v, mold)
1951 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1952 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
1953 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<8xi16>
1954 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
1955 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
1957 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1958 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<8xi16>
1959 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
1961 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1962 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <8 x i16>
1963 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
1964 end subroutine vec_convert_test_u8u2
1966 ! CHECK-LABEL: vec_convert_test_u8u4
1967 subroutine vec_convert_test_u8u4(v, mold)
1968 vector(unsigned(8)) :: v
1969 vector(unsigned(4)) :: mold, r
1970 r = vec_convert(v, mold)
1972 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1973 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
1974 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<4xi32>
1975 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
1976 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
1978 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
1979 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<4xi32>
1980 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
1982 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
1983 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <4 x i32>
1984 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
1985 end subroutine vec_convert_test_u8u4
1987 ! CHECK-LABEL: vec_convert_test_u8u8
1988 subroutine vec_convert_test_u8u8(v, mold)
1989 vector(unsigned(8)) :: v
1990 vector(unsigned(8)) :: mold, r
1991 r = vec_convert(v, mold)
1993 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1994 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
1995 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<2xi64>
1996 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
1997 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
1999 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
2000 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<2xi64>>
2002 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
2003 ! CHECK: store <2 x i64> %[[v]], ptr %{{.*}}, align 16
2004 end subroutine vec_convert_test_u8u8
2006 ! CHECK-LABEL: vec_convert_test_u8r4
2007 subroutine vec_convert_test_u8r4(v, mold)
2008 vector(unsigned(8)) :: v
2009 vector(real(4)) :: mold, r
2010 r = vec_convert(v, mold)
2012 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
2013 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
2014 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<4xf32>
2015 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
2016 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2018 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
2019 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<4xf32>
2020 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
2022 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
2023 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <4 x float>
2024 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
2025 end subroutine vec_convert_test_u8r4
2027 ! CHECK-LABEL: vec_convert_test_u8r8
2028 subroutine vec_convert_test_u8r8(v, mold)
2029 vector(unsigned(8)) :: v
2030 vector(real(8)) :: mold, r
2031 r = vec_convert(v, mold)
2033 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
2034 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
2035 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xi64> to vector<2xf64>
2036 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
2037 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2039 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
2040 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<2xf64>
2041 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
2043 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %0, align 16
2044 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <2 x double>
2045 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
2046 end subroutine vec_convert_test_u8r8
2048 ! CHECK-LABEL: vec_convert_test_r4i1
2049 subroutine vec_convert_test_r4i1(v, mold)
2050 vector(real(4)) :: v
2051 vector(integer(1)) :: mold, r
2052 r = vec_convert(v, mold)
2054 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2055 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2056 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<16xi8>
2057 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
2058 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
2060 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2061 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xf32> to vector<16xi8>
2062 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
2064 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2065 ! CHECK: %[[r:.*]] = bitcast <4 x float> %[[v]] to <16 x i8>
2066 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
2067 end subroutine vec_convert_test_r4i1
2069 ! CHECK-LABEL: vec_convert_test_r4i2
2070 subroutine vec_convert_test_r4i2(v, mold)
2071 vector(real(4)) :: v
2072 vector(integer(2)) :: mold, r
2073 r = vec_convert(v, mold)
2075 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2076 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2077 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<8xi16>
2078 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
2079 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
2081 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2082 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xf32> to vector<8xi16>
2083 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
2085 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2086 ! CHECK: %[[r:.*]] = bitcast <4 x float> %[[v]] to <8 x i16>
2087 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
2088 end subroutine vec_convert_test_r4i2
2090 ! CHECK-LABEL: vec_convert_test_r4i4
2091 subroutine vec_convert_test_r4i4(v, mold)
2092 vector(real(4)) :: v
2093 vector(integer(4)) :: mold, r
2094 r = vec_convert(v, mold)
2096 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2097 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2098 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<4xi32>
2099 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
2100 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
2102 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2103 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xf32> to vector<4xi32>
2104 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
2106 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2107 ! CHECK: %[[r:.*]] = bitcast <4 x float> %[[v]] to <4 x i32>
2108 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
2109 end subroutine vec_convert_test_r4i4
2111 ! CHECK-LABEL: vec_convert_test_r4i8
2112 subroutine vec_convert_test_r4i8(v, mold)
2113 vector(real(4)) :: v
2114 vector(integer(8)) :: mold, r
2115 r = vec_convert(v, mold)
2117 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2118 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2119 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<2xi64>
2120 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
2121 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
2123 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2124 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xf32> to vector<2xi64>
2125 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
2127 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2128 ! CHECK: %[[r:.*]] = bitcast <4 x float> %[[v]] to <2 x i64>
2129 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
2130 end subroutine vec_convert_test_r4i8
2132 ! CHECK-LABEL: vec_convert_test_r4u1
2133 subroutine vec_convert_test_r4u1(v, mold)
2134 vector(real(4)) :: v
2135 vector(unsigned(1)) :: mold, r
2136 r = vec_convert(v, mold)
2138 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2139 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2140 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<16xi8>
2141 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
2142 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
2144 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2145 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xf32> to vector<16xi8>
2146 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
2148 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2149 ! CHECK: %[[r:.*]] = bitcast <4 x float> %[[v]] to <16 x i8>
2150 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
2151 end subroutine vec_convert_test_r4u1
2153 ! CHECK-LABEL: vec_convert_test_r4u2
2154 subroutine vec_convert_test_r4u2(v, mold)
2155 vector(real(4)) :: v
2156 vector(unsigned(2)) :: mold, r
2157 r = vec_convert(v, mold)
2159 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2160 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2161 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<8xi16>
2162 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
2163 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
2165 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2166 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xf32> to vector<8xi16>
2167 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
2169 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2170 ! CHECK: %[[r:.*]] = bitcast <4 x float> %[[v]] to <8 x i16>
2171 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
2172 end subroutine vec_convert_test_r4u2
2174 ! CHECK-LABEL: vec_convert_test_r4u4
2175 subroutine vec_convert_test_r4u4(v, mold)
2176 vector(real(4)) :: v
2177 vector(unsigned(4)) :: mold, r
2178 r = vec_convert(v, mold)
2180 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2181 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2182 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<4xi32>
2183 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
2184 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
2186 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2187 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xf32> to vector<4xi32>
2188 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
2190 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2191 ! CHECK: %[[r:.*]] = bitcast <4 x float> %[[v]] to <4 x i32>
2192 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
2193 end subroutine vec_convert_test_r4u4
2195 ! CHECK-LABEL: vec_convert_test_r4u8
2196 subroutine vec_convert_test_r4u8(v, mold)
2197 vector(real(4)) :: v
2198 vector(unsigned(8)) :: mold, r
2199 r = vec_convert(v, mold)
2201 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2202 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2203 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<2xi64>
2204 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
2205 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
2207 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2208 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xf32> to vector<2xi64>
2209 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
2211 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2212 ! CHECK: %[[r:.*]] = bitcast <4 x float> %[[v]] to <2 x i64>
2213 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
2214 end subroutine vec_convert_test_r4u8
2216 ! CHECK-LABEL: vec_convert_test_r4r4
2217 subroutine vec_convert_test_r4r4(v, mold)
2218 vector(real(4)) :: v
2219 vector(real(4)) :: mold, r
2220 r = vec_convert(v, mold)
2222 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2223 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2224 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<4xf32>
2225 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
2226 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2228 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2229 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<4xf32>>
2231 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2232 ! CHECK: store <4 x float> %[[v]], ptr %{{.*}}, align 16
2233 end subroutine vec_convert_test_r4r4
2235 ! CHECK-LABEL: vec_convert_test_r4r8
2236 subroutine vec_convert_test_r4r8(v, mold)
2237 vector(real(4)) :: v
2238 vector(real(8)) :: mold, r
2239 r = vec_convert(v, mold)
2241 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2242 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<4:f32>) -> vector<4xf32>
2243 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<4xf32> to vector<2xf64>
2244 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
2245 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2247 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2248 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xf32> to vector<2xf64>
2249 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
2251 ! CHECK: %[[v:.*]] = load <4 x float>, ptr %0, align 16
2252 ! CHECK: %[[r:.*]] = bitcast <4 x float> %[[v]] to <2 x double>
2253 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
2254 end subroutine vec_convert_test_r4r8
2256 ! CHECK-LABEL: vec_convert_test_r8i1
2257 subroutine vec_convert_test_r8i1(v, mold)
2258 vector(real(8)) :: v
2259 vector(integer(1)) :: mold, r
2260 r = vec_convert(v, mold)
2262 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2263 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2264 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<16xi8>
2265 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
2266 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
2268 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2269 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xf64> to vector<16xi8>
2270 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
2272 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2273 ! CHECK: %[[r:.*]] = bitcast <2 x double> %[[v]] to <16 x i8>
2274 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
2275 end subroutine vec_convert_test_r8i1
2277 ! CHECK-LABEL: vec_convert_test_r8i2
2278 subroutine vec_convert_test_r8i2(v, mold)
2279 vector(real(8)) :: v
2280 vector(integer(2)) :: mold, r
2281 r = vec_convert(v, mold)
2283 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2284 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2285 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<8xi16>
2286 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
2287 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
2289 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2290 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xf64> to vector<8xi16>
2291 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
2293 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2294 ! CHECK: %[[r:.*]] = bitcast <2 x double> %[[v]] to <8 x i16>
2295 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
2296 end subroutine vec_convert_test_r8i2
2298 ! CHECK-LABEL: vec_convert_test_r8i4
2299 subroutine vec_convert_test_r8i4(v, mold)
2300 vector(real(8)) :: v
2301 vector(integer(4)) :: mold, r
2302 r = vec_convert(v, mold)
2304 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2305 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2306 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<4xi32>
2307 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:i32>
2308 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:i32>>
2310 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2311 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xf64> to vector<4xi32>
2312 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
2314 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2315 ! CHECK: %[[r:.*]] = bitcast <2 x double> %[[v]] to <4 x i32>
2316 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
2317 end subroutine vec_convert_test_r8i4
2319 ! CHECK-LABEL: vec_convert_test_r8i8
2320 subroutine vec_convert_test_r8i8(v, mold)
2321 vector(real(8)) :: v
2322 vector(integer(8)) :: mold, r
2323 r = vec_convert(v, mold)
2325 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2326 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2327 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<2xi64>
2328 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:i64>
2329 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:i64>>
2331 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2332 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xf64> to vector<2xi64>
2333 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
2335 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2336 ! CHECK: %[[r:.*]] = bitcast <2 x double> %[[v]] to <2 x i64>
2337 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
2338 end subroutine vec_convert_test_r8i8
2340 ! CHECK-LABEL: vec_convert_test_r8u1
2341 subroutine vec_convert_test_r8u1(v, mold)
2342 vector(real(8)) :: v
2343 vector(unsigned(1)) :: mold, r
2344 r = vec_convert(v, mold)
2346 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2347 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2348 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<16xi8>
2349 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:ui8>
2350 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:ui8>>
2352 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2353 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xf64> to vector<16xi8>
2354 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<16xi8>>
2356 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2357 ! CHECK: %[[r:.*]] = bitcast <2 x double> %[[v]] to <16 x i8>
2358 ! CHECK: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
2359 end subroutine vec_convert_test_r8u1
2361 ! CHECK-LABEL: vec_convert_test_r8u2
2362 subroutine vec_convert_test_r8u2(v, mold)
2363 vector(real(8)) :: v
2364 vector(unsigned(2)) :: mold, r
2365 r = vec_convert(v, mold)
2367 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2368 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2369 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<8xi16>
2370 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:ui16>
2371 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:ui16>>
2373 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2374 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xf64> to vector<8xi16>
2375 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
2377 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2378 ! CHECK: %[[r:.*]] = bitcast <2 x double> %[[v]] to <8 x i16>
2379 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
2380 end subroutine vec_convert_test_r8u2
2382 ! CHECK-LABEL: vec_convert_test_r8u4
2383 subroutine vec_convert_test_r8u4(v, mold)
2384 vector(real(8)) :: v
2385 vector(unsigned(4)) :: mold, r
2386 r = vec_convert(v, mold)
2388 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2389 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2390 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<4xi32>
2391 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xi32>) -> !fir.vector<4:ui32>
2392 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:ui32>>
2394 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2395 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xf64> to vector<4xi32>
2396 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xi32>>
2398 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2399 ! CHECK: %[[r:.*]] = bitcast <2 x double> %[[v]] to <4 x i32>
2400 ! CHECK: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
2401 end subroutine vec_convert_test_r8u4
2403 ! CHECK-LABEL: vec_convert_test_r8u8
2404 subroutine vec_convert_test_r8u8(v, mold)
2405 vector(real(8)) :: v
2406 vector(unsigned(8)) :: mold, r
2407 r = vec_convert(v, mold)
2409 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2410 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2411 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<2xi64>
2412 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xi64>) -> !fir.vector<2:ui64>
2413 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
2415 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2416 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xf64> to vector<2xi64>
2417 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xi64>>
2419 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2420 ! CHECK: %[[r:.*]] = bitcast <2 x double> %[[v]] to <2 x i64>
2421 ! CHECK: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
2422 end subroutine vec_convert_test_r8u8
2424 ! CHECK-LABEL: vec_convert_test_r8r4
2425 subroutine vec_convert_test_r8r4(v, mold)
2426 vector(real(8)) :: v
2427 vector(real(4)) :: mold, r
2428 r = vec_convert(v, mold)
2430 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2431 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2432 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<4xf32>
2433 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<4xf32>) -> !fir.vector<4:f32>
2434 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2436 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2437 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xf64> to vector<4xf32>
2438 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
2440 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2441 ! CHECK: %[[r:.*]] = bitcast <2 x double> %[[v]] to <4 x float>
2442 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
2443 end subroutine vec_convert_test_r8r4
2445 ! CHECK-LABEL: vec_convert_test_r8r8
2446 subroutine vec_convert_test_r8r8(v, mold)
2447 vector(real(8)) :: v
2448 vector(real(8)) :: mold, r
2449 r = vec_convert(v, mold)
2451 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2452 ! CHECK-FIR: %[[vc:.*]] = fir.convert %[[v]] : (!fir.vector<2:f64>) -> vector<2xf64>
2453 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[vc]] : vector<2xf64> to vector<2xf64>
2454 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
2455 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2457 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2458 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<2xf64>>
2460 ! CHECK: %[[v:.*]] = load <2 x double>, ptr %0, align 16
2461 ! CHECK: store <2 x double> %[[v]], ptr %{{.*}}, align 16
2462 end subroutine vec_convert_test_r8r8
2464 ! CHECK-LABEL: vec_convert_test_i1i1_array
2465 subroutine vec_convert_test_i1i1_array(v, mold)
2466 vector(integer(1)) :: v
2467 vector(integer(1)) :: mold(4, 8), r
2468 r = vec_convert(v, mold)
2470 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<16:i8>>
2471 ! CHECK-FIR: %[[cv:.*]] = fir.convert %[[v]] : (!fir.vector<16:i8>) -> vector<16xi8>
2472 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[cv]] : vector<16xi8> to vector<16xi8>
2473 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<16xi8>) -> !fir.vector<16:i8>
2474 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<16:i8>>
2476 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<16xi8>>
2477 ! CHECK-LLVMIR: llvm.store %[[v]], %{{.*}} : !llvm.ptr<vector<16xi8>>
2479 ! CHECK: %[[v:.*]] = load <16 x i8>, ptr %{{.*}}, align 16
2480 ! CHECK: store <16 x i8> %[[v]], ptr %{{.*}}, align 16
2481 end subroutine vec_convert_test_i1i1_array
2483 ! CHECK-LABEL: vec_convert_test_i4r8_array
2484 subroutine vec_convert_test_i4r8_array(v, mold)
2485 vector(integer(4)) :: v
2486 vector(real(8)) :: mold(2, 4, 8), r
2487 r = vec_convert(v, mold)
2489 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:i32>>
2490 ! CHECK-FIR: %[[cv:.*]] = fir.convert %[[v]] : (!fir.vector<4:i32>) -> vector<4xi32>
2491 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[cv]] : vector<4xi32> to vector<2xf64>
2492 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<2xf64>) -> !fir.vector<2:f64>
2493 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2495 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xi32>>
2496 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<4xi32> to vector<2xf64>
2497 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
2499 ! CHECK: %[[v:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
2500 ! CHECK: %[[r:.*]] = bitcast <4 x i32> %[[v]] to <2 x double>
2501 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
2502 end subroutine vec_convert_test_i4r8_array
2504 ! CHECK-LABEL: vec_convert_test_u8i2_array
2505 subroutine vec_convert_test_u8i2_array(v, mold)
2506 vector(unsigned(8)) :: v
2507 vector(integer(2)) :: mold(10), r
2508 r = vec_convert(v, mold)
2510 ! CHECK-FIR: %[[v:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:ui64>>
2511 ! CHECK-FIR: %[[cv:.*]] = fir.convert %[[v]] : (!fir.vector<2:ui64>) -> vector<2xi64>
2512 ! CHECK-FIR: %[[b:.*]] = llvm.bitcast %[[cv]] : vector<2xi64> to vector<8xi16>
2513 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[b]] : (vector<8xi16>) -> !fir.vector<8:i16>
2514 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<8:i16>>
2516 ! CHECK-LLVMIR: %[[v:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xi64>>
2517 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[v]] : vector<2xi64> to vector<8xi16>
2518 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<8xi16>>
2520 ! CHECK: %[[v:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
2521 ! CHECK: %[[r:.*]] = bitcast <2 x i64> %[[v]] to <8 x i16>
2522 ! CHECK: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
2523 end subroutine vec_convert_test_u8i2_array
2525 !---------
2526 ! vec_cvf
2527 !---------
2528 ! CHECK-LABEL: vec_cvf_test_r4r8
2529 subroutine vec_cvf_test_r4r8(arg1)
2530 vector(real(8)), intent(in) :: arg1
2531 vector(real(4)) :: r
2532 r = vec_cvf(arg1)
2534 ! CHECK-FIR: %[[arg:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2535 ! CHECK-FIR: %[[carg:.*]] = fir.convert %[[arg]] : (!fir.vector<2:f64>) -> vector<2xf64>
2536 ! CHECK-FIR: %[[call:.*]] = fir.call @llvm.ppc.vsx.xvcvdpsp(%[[carg]]) fastmath<contract> : (vector<2xf64>) -> !fir.vector<4:f32>
2537 ! CHECK-FIR: %[[ccall:.*]] = fir.convert %[[call]] : (!fir.vector<4:f32>) -> vector<4xf32>
2538 ! CHECK-FIR: %[[bfi:.*]] = llvm.bitcast %[[ccall]] : vector<4xf32> to vector<16xi8>
2539 ! CHECK-FIR: %[[sh:.*]] = vector.shuffle %[[bfi]], %[[bfi]] [4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11] : vector<16xi8>, vector<16xi8>
2540 ! CHECK-FIR: %[[bif:.*]] = llvm.bitcast %[[sh]] : vector<16xi8> to vector<4xf32>
2541 ! CHECK-FIR: %[[r:.*]] = fir.convert %[[bif]] : (vector<4xf32>) -> !fir.vector<4:f32>
2542 ! CHECK-FIR: fir.store %[[r]] to %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2544 ! CHECK-LLVMIR: %[[arg:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<2xf64>>
2545 ! CHECK-LLVMIR: %[[call:.*]] = llvm.call @llvm.ppc.vsx.xvcvdpsp(%[[arg]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<2xf64>) -> vector<4xf32>
2546 ! CHECK-LLVMIR: %[[b:.*]] = llvm.bitcast %[[call]] : vector<4xf32> to vector<16xi8>
2547 ! CHECK-LLVMIR: %[[sh:.*]] = llvm.shufflevector %[[b]], %[[b]] [4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11] : vector<16xi8>
2548 ! CHECK-LLVMIR: %[[r:.*]] = llvm.bitcast %[[sh]] : vector<16xi8> to vector<4xf32>
2549 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<4xf32>>
2551 ! CHECK: %[[arg:.*]] = load <2 x double>, ptr %{{.*}}, align 16
2552 ! CHECK: %[[call:.*]] = call contract <4 x float> @llvm.ppc.vsx.xvcvdpsp(<2 x double> %[[arg]])
2553 ! CHECK: %[[b:.*]] = bitcast <4 x float> %[[call]] to <16 x i8>
2554 ! CHECK: %[[sh:.*]] = shufflevector <16 x i8> %[[b]], <16 x i8> %[[b]], <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15, i32 8, i32 9, i32 10, i32 11>
2555 ! CHECK: %[[r:.*]] = bitcast <16 x i8> %[[sh]] to <4 x float>
2556 ! CHECK: store <4 x float> %[[r]], ptr %{{.*}}, align 16
2557 end subroutine vec_cvf_test_r4r8
2559 ! CHECK-LABEL: vec_cvf_test_r8r4
2560 subroutine vec_cvf_test_r8r4(arg1)
2561 vector(real(4)), intent(in) :: arg1
2562 vector(real(8)) :: r
2563 r = vec_cvf(arg1)
2565 ! CHECK-FIR: %[[arg:.*]] = fir.load %{{.*}} : !fir.ref<!fir.vector<4:f32>>
2566 ! CHECK-FIR: %[[carg:.*]] = fir.convert %[[arg]] : (!fir.vector<4:f32>) -> vector<4xf32>
2567 ! CHECK-FIR: %[[bfi:.*]] = llvm.bitcast %[[carg]] : vector<4xf32> to vector<16xi8>
2568 ! CHECK-FIR: %[[sh:.*]] = vector.shuffle %[[bfi]], %[[bfi]] [4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11] : vector<16xi8>, vector<16xi8>
2569 ! CHECK-FIR: %[[bif:.*]] = llvm.bitcast %[[sh]] : vector<16xi8> to vector<4xf32>
2570 ! CHECK-FIR: %[[call:.*]] = fir.call @llvm.ppc.vsx.xvcvspdp(%[[bif]]) fastmath<contract> : (vector<4xf32>) -> !fir.vector<2:f64>
2571 ! CHECK-FIR: fir.store %[[call]] to %{{.*}} : !fir.ref<!fir.vector<2:f64>>
2573 ! CHECK-LLVMIR: %[[arg:.*]] = llvm.load %{{.*}} : !llvm.ptr<vector<4xf32>>
2574 ! CHECK-LLVMIR: %[[bfi:.*]] = llvm.bitcast %[[arg]] : vector<4xf32> to vector<16xi8>
2575 ! CHECK-LLVMIR: %[[sh:.*]] = llvm.shufflevector %[[bfi]], %[[bfi]] [4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11] : vector<16xi8>
2576 ! CHECK-LLVMIR: %[[bif:.*]] = llvm.bitcast %[[sh]] : vector<16xi8> to vector<4xf32>
2577 ! CHECK-LLVMIR: %[[r:.*]] = llvm.call @llvm.ppc.vsx.xvcvspdp(%[[bif]]) {fastmathFlags = #llvm.fastmath<contract>} : (vector<4xf32>) -> vector<2xf64>
2578 ! CHECK-LLVMIR: llvm.store %[[r]], %{{.*}} : !llvm.ptr<vector<2xf64>>
2580 ! CHECK: %[[arg:.*]] = load <4 x float>, ptr %{{.*}}, align 16
2581 ! CHECK: %[[bfi:.*]] = bitcast <4 x float> %[[arg]] to <16 x i8>
2582 ! CHECK: %[[sh:.*]] = shufflevector <16 x i8> %[[bfi]], <16 x i8> %[[bfi]], <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15, i32 8, i32 9, i32 10, i32 11>
2583 ! CHECK: %[[bif:.*]] = bitcast <16 x i8> %[[sh]] to <4 x float>
2584 ! CHECK: %[[r:.*]] = call contract <2 x double> @llvm.ppc.vsx.xvcvspdp(<4 x float> %[[bif]])
2585 ! CHECK: store <2 x double> %[[r]], ptr %{{.*}}, align 16
2586 end subroutine vec_cvf_test_r8r4