1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mattr=+vsx \
3 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
5 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=-power9-vector \
6 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
8 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=+vsx \
9 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s \
10 ; RUN: --check-prefix=CHECK-P9 --implicit-check-not xxswapd
12 define <2 x double> @test00(ptr %p1, ptr %p2) {
13 ; CHECK-LABEL: test00:
15 ; CHECK-NEXT: lxvdsx 34, 0, 3
18 ; CHECK-P9-LABEL: test00:
20 ; CHECK-P9-NEXT: lxvdsx 34, 0, 3
22 %v1 = load <2 x double>, ptr %p1
23 %v2 = load <2 x double>, ptr %p2
24 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 0>
28 define <2 x double> @test01(ptr %p1, ptr %p2) {
29 ; CHECK-LABEL: test01:
31 ; CHECK-NEXT: lxvd2x 0, 0, 3
32 ; CHECK-NEXT: xxswapd 34, 0
35 ; CHECK-P9-LABEL: test01:
37 ; CHECK-P9-NEXT: lxv 34, 0(3)
39 %v1 = load <2 x double>, ptr %p1
40 %v2 = load <2 x double>, ptr %p2
41 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 1>
45 define <2 x double> @test02(ptr %p1, ptr %p2) {
46 ; CHECK-LABEL: test02:
48 ; CHECK-NEXT: lxvd2x 0, 0, 3
49 ; CHECK-NEXT: lxvd2x 1, 0, 4
50 ; CHECK-NEXT: xxswapd 0, 0
51 ; CHECK-NEXT: xxswapd 1, 1
52 ; CHECK-NEXT: xxmrgld 34, 1, 0
55 ; CHECK-P9-LABEL: test02:
57 ; CHECK-P9-NEXT: lxv 0, 0(3)
58 ; CHECK-P9-NEXT: lxv 1, 0(4)
59 ; CHECK-P9-NEXT: xxmrgld 34, 1, 0
61 %v1 = load <2 x double>, ptr %p1
62 %v2 = load <2 x double>, ptr %p2
63 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 2>
67 define <2 x double> @test03(ptr %p1, ptr %p2) {
68 ; CHECK-LABEL: test03:
70 ; CHECK-NEXT: lxvd2x 0, 0, 3
71 ; CHECK-NEXT: lxvd2x 1, 0, 4
72 ; CHECK-NEXT: xxswapd 0, 0
73 ; CHECK-NEXT: xxswapd 1, 1
74 ; CHECK-NEXT: xxpermdi 34, 1, 0, 1
77 ; CHECK-P9-LABEL: test03:
79 ; CHECK-P9-NEXT: lxv 0, 0(3)
80 ; CHECK-P9-NEXT: lxv 1, 0(4)
81 ; CHECK-P9-NEXT: xxpermdi 34, 1, 0, 1
83 %v1 = load <2 x double>, ptr %p1
84 %v2 = load <2 x double>, ptr %p2
85 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 3>
89 define <2 x double> @test10(ptr %p1, ptr %p2) {
90 ; CHECK-LABEL: test10:
92 ; CHECK-NEXT: lxvd2x 34, 0, 3
95 ; CHECK-P9-LABEL: test10:
97 ; CHECK-P9-NEXT: lxvd2x 34, 0, 3
99 %v1 = load <2 x double>, ptr %p1
100 %v2 = load <2 x double>, ptr %p2
101 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 0>
105 define <2 x double> @test11(ptr %p1, ptr %p2) {
106 ; CHECK-LABEL: test11:
108 ; CHECK-NEXT: addi 3, 3, 8
109 ; CHECK-NEXT: lxvdsx 34, 0, 3
112 ; CHECK-P9-LABEL: test11:
114 ; CHECK-P9-NEXT: addi 3, 3, 8
115 ; CHECK-P9-NEXT: lxvdsx 34, 0, 3
117 %v1 = load <2 x double>, ptr %p1
118 %v2 = load <2 x double>, ptr %p2
119 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 1>
123 define <2 x double> @test12(ptr %p1, ptr %p2) {
124 ; CHECK-LABEL: test12:
126 ; CHECK-NEXT: lxvd2x 0, 0, 3
127 ; CHECK-NEXT: lxvd2x 1, 0, 4
128 ; CHECK-NEXT: xxswapd 0, 0
129 ; CHECK-NEXT: xxswapd 1, 1
130 ; CHECK-NEXT: xxpermdi 34, 1, 0, 2
133 ; CHECK-P9-LABEL: test12:
135 ; CHECK-P9-NEXT: lxv 0, 0(3)
136 ; CHECK-P9-NEXT: lxv 1, 0(4)
137 ; CHECK-P9-NEXT: xxpermdi 34, 1, 0, 2
139 %v1 = load <2 x double>, ptr %p1
140 %v2 = load <2 x double>, ptr %p2
141 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 2>
145 define <2 x double> @test13(ptr %p1, ptr %p2) {
146 ; CHECK-LABEL: test13:
148 ; CHECK-NEXT: lxvd2x 0, 0, 3
149 ; CHECK-NEXT: lxvd2x 1, 0, 4
150 ; CHECK-NEXT: xxswapd 0, 0
151 ; CHECK-NEXT: xxswapd 1, 1
152 ; CHECK-NEXT: xxmrghd 34, 1, 0
155 ; CHECK-P9-LABEL: test13:
157 ; CHECK-P9-NEXT: lxv 0, 0(3)
158 ; CHECK-P9-NEXT: lxv 1, 0(4)
159 ; CHECK-P9-NEXT: xxmrghd 34, 1, 0
161 %v1 = load <2 x double>, ptr %p1
162 %v2 = load <2 x double>, ptr %p2
163 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 3>
167 define <2 x double> @test20(ptr %p1, ptr %p2) {
168 ; CHECK-LABEL: test20:
170 ; CHECK-NEXT: lxvd2x 0, 0, 3
171 ; CHECK-NEXT: lxvd2x 1, 0, 4
172 ; CHECK-NEXT: xxswapd 0, 0
173 ; CHECK-NEXT: xxswapd 1, 1
174 ; CHECK-NEXT: xxmrgld 34, 0, 1
177 ; CHECK-P9-LABEL: test20:
179 ; CHECK-P9-NEXT: lxv 0, 0(3)
180 ; CHECK-P9-NEXT: lxv 1, 0(4)
181 ; CHECK-P9-NEXT: xxmrgld 34, 0, 1
183 %v1 = load <2 x double>, ptr %p1
184 %v2 = load <2 x double>, ptr %p2
185 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 0>
189 define <2 x double> @test21(ptr %p1, ptr %p2) {
190 ; CHECK-LABEL: test21:
192 ; CHECK-NEXT: lxvd2x 0, 0, 3
193 ; CHECK-NEXT: lxvd2x 1, 0, 4
194 ; CHECK-NEXT: xxswapd 0, 0
195 ; CHECK-NEXT: xxswapd 1, 1
196 ; CHECK-NEXT: xxpermdi 34, 0, 1, 1
199 ; CHECK-P9-LABEL: test21:
201 ; CHECK-P9-NEXT: lxv 0, 0(3)
202 ; CHECK-P9-NEXT: lxv 1, 0(4)
203 ; CHECK-P9-NEXT: xxpermdi 34, 0, 1, 1
205 %v1 = load <2 x double>, ptr %p1
206 %v2 = load <2 x double>, ptr %p2
207 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 1>
211 define <2 x double> @test22(ptr %p1, ptr %p2) {
212 ; CHECK-LABEL: test22:
214 ; CHECK-NEXT: lxvdsx 34, 0, 4
217 ; CHECK-P9-LABEL: test22:
219 ; CHECK-P9-NEXT: lxvdsx 34, 0, 4
221 %v1 = load <2 x double>, ptr %p1
222 %v2 = load <2 x double>, ptr %p2
223 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 2>
227 define <2 x double> @test23(ptr %p1, ptr %p2) {
228 ; CHECK-LABEL: test23:
230 ; CHECK-NEXT: lxvd2x 0, 0, 4
231 ; CHECK-NEXT: xxswapd 34, 0
234 ; CHECK-P9-LABEL: test23:
236 ; CHECK-P9-NEXT: lxv 34, 0(4)
238 %v1 = load <2 x double>, ptr %p1
239 %v2 = load <2 x double>, ptr %p2
240 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 3>
244 define <2 x double> @test30(ptr %p1, ptr %p2) {
245 ; CHECK-LABEL: test30:
247 ; CHECK-NEXT: lxvd2x 0, 0, 3
248 ; CHECK-NEXT: lxvd2x 1, 0, 4
249 ; CHECK-NEXT: xxswapd 0, 0
250 ; CHECK-NEXT: xxswapd 1, 1
251 ; CHECK-NEXT: xxpermdi 34, 0, 1, 2
254 ; CHECK-P9-LABEL: test30:
256 ; CHECK-P9-NEXT: lxv 0, 0(3)
257 ; CHECK-P9-NEXT: lxv 1, 0(4)
258 ; CHECK-P9-NEXT: xxpermdi 34, 0, 1, 2
260 %v1 = load <2 x double>, ptr %p1
261 %v2 = load <2 x double>, ptr %p2
262 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 0>
266 define <2 x double> @test31(ptr %p1, ptr %p2) {
267 ; CHECK-LABEL: test31:
269 ; CHECK-NEXT: lxvd2x 0, 0, 3
270 ; CHECK-NEXT: lxvd2x 1, 0, 4
271 ; CHECK-NEXT: xxswapd 0, 0
272 ; CHECK-NEXT: xxswapd 1, 1
273 ; CHECK-NEXT: xxmrghd 34, 0, 1
276 ; CHECK-P9-LABEL: test31:
278 ; CHECK-P9-NEXT: lxv 0, 0(3)
279 ; CHECK-P9-NEXT: lxv 1, 0(4)
280 ; CHECK-P9-NEXT: xxmrghd 34, 0, 1
282 %v1 = load <2 x double>, ptr %p1
283 %v2 = load <2 x double>, ptr %p2
284 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 1>
288 define <2 x double> @test32(ptr %p1, ptr %p2) {
289 ; CHECK-LABEL: test32:
291 ; CHECK-NEXT: lxvd2x 34, 0, 4
294 ; CHECK-P9-LABEL: test32:
296 ; CHECK-P9-NEXT: lxvd2x 34, 0, 4
298 %v1 = load <2 x double>, ptr %p1
299 %v2 = load <2 x double>, ptr %p2
300 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 2>
304 define <2 x double> @test33(ptr %p1, ptr %p2) {
305 ; CHECK-LABEL: test33:
307 ; CHECK-NEXT: addi 3, 4, 8
308 ; CHECK-NEXT: lxvdsx 34, 0, 3
311 ; CHECK-P9-LABEL: test33:
313 ; CHECK-P9-NEXT: addi 3, 4, 8
314 ; CHECK-P9-NEXT: lxvdsx 34, 0, 3
316 %v1 = load <2 x double>, ptr %p1
317 %v2 = load <2 x double>, ptr %p2
318 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 3>