1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-vsr-nums-as-vr \
3 ; RUN: -ppc-asm-full-reg-names -global-isel -o - < %s | FileCheck %s
5 ; Test returning vectors in functions
6 define <16 x i8> @test_ret_v16i8(<16 x i8> %a){
7 ; CHECK-LABEL: test_ret_v16i8:
13 define <8 x i16> @test_ret_v8i16(<8 x i16> %a){
14 ; CHECK-LABEL: test_ret_v8i16:
20 define <4 x i32> @test_ret_v4i32(<4 x i32> %a){
21 ; CHECK-LABEL: test_ret_v4i32:
27 define <2 x i64> @test_ret_v2i64(<2 x i64> %a){
28 ; CHECK-LABEL: test_ret_v2i64:
34 define <4 x float> @test_ret_v4f32(<4 x float> %a){
35 ; CHECK-LABEL: test_ret_v4f32:
41 define <2 x double> @test_ret_v2f64(<2 x double> %a){
42 ; CHECK-LABEL: test_ret_v2f64:
48 ; Test simple bitcasting of vectors
49 define <16 x i8> @test_bitcast_v16i8_v16i8(<16 x i8> %a){
50 ; CHECK-LABEL: test_bitcast_v16i8_v16i8:
53 %res = bitcast <16 x i8> %a to <16 x i8>
57 define <16 x i8> @test_bitcast_v16i8_v8i16(<8 x i16> %a){
58 ; CHECK-LABEL: test_bitcast_v16i8_v8i16:
61 %res = bitcast <8 x i16> %a to <16 x i8>
65 define <16 x i8> @test_bitcast_v16i8_v4i32(<4 x i32> %a){
66 ; CHECK-LABEL: test_bitcast_v16i8_v4i32:
69 %res = bitcast <4 x i32> %a to <16 x i8>
73 define <16 x i8> @test_bitcast_v16i8_v2i64(<2 x i64> %a){
74 ; CHECK-LABEL: test_bitcast_v16i8_v2i64:
77 %res = bitcast <2 x i64> %a to <16 x i8>
81 define <16 x i8> @test_bitcast_v16i8_v4f32(<4 x float> %a){
82 ; CHECK-LABEL: test_bitcast_v16i8_v4f32:
85 %res = bitcast <4 x float> %a to <16 x i8>
89 define <16 x i8> @test_bitcast_v16i8_v2f64(<2 x double> %a){
90 ; CHECK-LABEL: test_bitcast_v16i8_v2f64:
93 %res = bitcast <2 x double> %a to <16 x i8>
97 define <8 x i16> @test_bitcast_v8i16_v16i8(<16 x i8> %a) {
98 ; CHECK-LABEL: test_bitcast_v8i16_v16i8:
101 %res = bitcast <16 x i8> %a to <8 x i16>
105 define <8 x i16> @test_bitcast_v8i16_v8i16(<8 x i16> %a) {
106 ; CHECK-LABEL: test_bitcast_v8i16_v8i16:
109 %res = bitcast <8 x i16> %a to <8 x i16>
113 define <8 x i16> @test_bitcast_v8i16_v4i32(<4 x i32> %a) {
114 ; CHECK-LABEL: test_bitcast_v8i16_v4i32:
117 %res = bitcast <4 x i32> %a to <8 x i16>
121 define <8 x i16> @test_bitcast_v8i16_v2i64(<2 x i64> %a) {
122 ; CHECK-LABEL: test_bitcast_v8i16_v2i64:
125 %res = bitcast <2 x i64> %a to <8 x i16>
129 define <8 x i16> @test_bitcast_v8i16_v4f32(<4 x float> %a){
130 ; CHECK-LABEL: test_bitcast_v8i16_v4f32:
133 %res = bitcast <4 x float> %a to <8 x i16>
137 define <8 x i16> @test_bitcast_v8i16_v2f64(<2 x double> %a){
138 ; CHECK-LABEL: test_bitcast_v8i16_v2f64:
141 %res = bitcast <2 x double> %a to <8 x i16>
145 define <4 x i32> @test_bitcast_v4i32_v16i8(<16 x i8> %a) {
146 ; CHECK-LABEL: test_bitcast_v4i32_v16i8:
149 %res = bitcast <16 x i8> %a to <4 x i32>
153 define <4 x i32> @test_bitcast_v4i32_v8i16(<8 x i16> %a) {
154 ; CHECK-LABEL: test_bitcast_v4i32_v8i16:
157 %res = bitcast <8 x i16> %a to <4 x i32>
161 define <4 x i32> @test_bitcast_v4i32_v4i32(<4 x i32> %a) {
162 ; CHECK-LABEL: test_bitcast_v4i32_v4i32:
165 %res = bitcast <4 x i32> %a to <4 x i32>
169 define <4 x i32> @test_bitcast_v4i32_v2i64(<2 x i64> %a) {
170 ; CHECK-LABEL: test_bitcast_v4i32_v2i64:
173 %res = bitcast <2 x i64> %a to <4 x i32>
177 define <4 x i32> @test_bitcast_v4i32_v4f32(<4 x float> %a){
178 ; CHECK-LABEL: test_bitcast_v4i32_v4f32:
181 %res = bitcast <4 x float> %a to <4 x i32>
185 define <4 x i32> @test_bitcast_v4i32_v2f64(<2 x double> %a){
186 ; CHECK-LABEL: test_bitcast_v4i32_v2f64:
189 %res = bitcast <2 x double> %a to <4 x i32>
193 define <2 x i64> @test_bitcast_v2i64_v16i8(<16 x i8> %a) {
194 ; CHECK-LABEL: test_bitcast_v2i64_v16i8:
197 %res = bitcast <16 x i8> %a to <2 x i64>
201 define <2 x i64> @test_bitcast_v2i64_v8i16(<8 x i16> %a) {
202 ; CHECK-LABEL: test_bitcast_v2i64_v8i16:
205 %res = bitcast <8 x i16> %a to <2 x i64>
209 define <2 x i64> @test_bitcast_v2i64_v4i32(<4 x i32> %a) {
210 ; CHECK-LABEL: test_bitcast_v2i64_v4i32:
213 %res = bitcast <4 x i32> %a to <2 x i64>
217 define <2 x i64> @test_bitcast_v2i64_v2i64(<2 x i64> %a) {
218 ; CHECK-LABEL: test_bitcast_v2i64_v2i64:
221 %res = bitcast <2 x i64> %a to <2 x i64>
225 define <2 x i64> @test_bitcast_v2i64_v4f32(<4 x float> %a){
226 ; CHECK-LABEL: test_bitcast_v2i64_v4f32:
229 %res = bitcast <4 x float> %a to <2 x i64>
233 define <2 x i64> @test_bitcast_v2i64_v2f64(<2 x double> %a){
234 ; CHECK-LABEL: test_bitcast_v2i64_v2f64:
237 %res = bitcast <2 x double> %a to <2 x i64>
241 define <4 x float> @test_bitcast_v4f32_v16i8(<16 x i8> %a) {
242 ; CHECK-LABEL: test_bitcast_v4f32_v16i8:
245 %res = bitcast <16 x i8> %a to <4 x float>
249 define <4 x float> @test_bitcast_v4f32_v8i16(<8 x i16> %a) {
250 ; CHECK-LABEL: test_bitcast_v4f32_v8i16:
253 %res = bitcast <8 x i16> %a to <4 x float>
257 define <4 x float> @test_bitcast_v4f32_v4i32(<4 x i32> %a) {
258 ; CHECK-LABEL: test_bitcast_v4f32_v4i32:
261 %res = bitcast <4 x i32> %a to <4 x float>
265 define <4 x float> @test_bitcast_v4f32_v2i64(<2 x i64> %a) {
266 ; CHECK-LABEL: test_bitcast_v4f32_v2i64:
269 %res = bitcast <2 x i64> %a to <4 x float>
273 define <4 x float> @test_bitcast_v4f32_v4f32(<4 x float> %a){
274 ; CHECK-LABEL: test_bitcast_v4f32_v4f32:
277 %res = bitcast <4 x float> %a to <4 x float>
281 define <4 x float> @test_bitcast_v4f32_v2f64(<2 x double> %a){
282 ; CHECK-LABEL: test_bitcast_v4f32_v2f64:
285 %res = bitcast <2 x double> %a to <4 x float>
289 define <2 x double> @test_bitcast_v2f64_v16i8(<16 x i8> %a) {
290 ; CHECK-LABEL: test_bitcast_v2f64_v16i8:
293 %res = bitcast <16 x i8> %a to <2 x double>
294 ret <2 x double> %res
297 define <2 x double> @test_bitcast_v2f64_v8i16(<8 x i16> %a) {
298 ; CHECK-LABEL: test_bitcast_v2f64_v8i16:
301 %res = bitcast <8 x i16> %a to <2 x double>
302 ret <2 x double> %res
305 define <2 x double> @test_bitcast_v2f64_v4i32(<4 x i32> %a) {
306 ; CHECK-LABEL: test_bitcast_v2f64_v4i32:
309 %res = bitcast <4 x i32> %a to <2 x double>
310 ret <2 x double> %res
313 define <2 x double> @test_bitcast_v2f64_v2i64(<2 x i64> %a) {
314 ; CHECK-LABEL: test_bitcast_v2f64_v2i64:
317 %res = bitcast <2 x i64> %a to <2 x double>
318 ret <2 x double> %res
321 define <2 x double> @test_bitcast_v2f64_v4f32(<4 x float> %a){
322 ; CHECK-LABEL: test_bitcast_v2f64_v4f32:
325 %res = bitcast <4 x float> %a to <2 x double>
326 ret <2 x double> %res
329 define <2 x double> @test_bitcast_v2f64_v2f64(<2 x double> %a){
330 ; CHECK-LABEL: test_bitcast_v2f64_v2f64:
333 %res = bitcast <2 x double> %a to <2 x double>
334 ret <2 x double> %res