1 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mattr=+vsx \
2 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
4 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=-power9-vector \
5 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
7 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=+vsx \
8 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s \
9 ; RUN: --check-prefix=CHECK-P9 --implicit-check-not xxswapd
11 define <2 x double> @test00(<2 x double>* %p1, <2 x double>* %p2) {
12 %v1 = load <2 x double>, <2 x double>* %p1
13 %v2 = load <2 x double>, <2 x double>* %p2
14 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 0>
18 ; CHECK: lxvd2x 0, 0, 3
19 ; CHECK: xxspltd 34, 0, 0
21 ; CHECK-P9-LABEL: test00
22 ; CHECK-P9: lxv 0, 0(3)
23 ; CHECK-P9: xxspltd 34, 0, 1
26 define <2 x double> @test01(<2 x double>* %p1, <2 x double>* %p2) {
27 %v1 = load <2 x double>, <2 x double>* %p1
28 %v2 = load <2 x double>, <2 x double>* %p2
29 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 1>
33 ; CHECK: lxvd2x 0, 0, 3
34 ; CHECK: xxswapd 34, 0
36 ; CHECK-P9-LABEL: test01
37 ; CHECK-P9: lxv 34, 0(3)
40 define <2 x double> @test02(<2 x double>* %p1, <2 x double>* %p2) {
41 %v1 = load <2 x double>, <2 x double>* %p1
42 %v2 = load <2 x double>, <2 x double>* %p2
43 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 2>
46 ; CHECK-LABEL: @test02
47 ; CHECK: lxvd2x 0, 0, 3
48 ; CHECK: lxvd2x 1, 0, 4
51 ; CHECK: xxmrgld 34, 1, 0
53 ; CHECK-P9-LABEL: @test02
54 ; CHECK-P9: lxv 0, 0(3)
55 ; CHECK-P9: lxv 1, 0(4)
56 ; CHECK-P9: xxmrgld 34, 1, 0
59 define <2 x double> @test03(<2 x double>* %p1, <2 x double>* %p2) {
60 %v1 = load <2 x double>, <2 x double>* %p1
61 %v2 = load <2 x double>, <2 x double>* %p2
62 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 3>
65 ; CHECK-LABEL: @test03
66 ; CHECK: lxvd2x 0, 0, 3
67 ; CHECK: lxvd2x 1, 0, 4
70 ; CHECK: xxpermdi 34, 1, 0, 1
72 ; CHECK-P9-LABEL: @test03
73 ; CHECK-P9: lxv 0, 0(3)
74 ; CHECK-P9: lxv 1, 0(4)
75 ; CHECK-P9: xxpermdi 34, 1, 0, 1
78 define <2 x double> @test10(<2 x double>* %p1, <2 x double>* %p2) {
79 %v1 = load <2 x double>, <2 x double>* %p1
80 %v2 = load <2 x double>, <2 x double>* %p2
81 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 0>
84 ; CHECK-LABEL: @test10
85 ; CHECK: lxvd2x 34, 0, 3
87 ; CHECK-P9-LABEL: @test10
88 ; CHECK-P9: lxvd2x 34, 0, 3
91 define <2 x double> @test11(<2 x double>* %p1, <2 x double>* %p2) {
92 %v1 = load <2 x double>, <2 x double>* %p1
93 %v2 = load <2 x double>, <2 x double>* %p2
94 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 1>
97 ; CHECK-LABEL: @test11
98 ; CHECK: lxvd2x 0, 0, 3
99 ; CHECK: xxspltd 34, 0, 1
101 ; CHECK-P9-LABEL: @test11
102 ; CHECK-P9: lxv 0, 0(3)
103 ; CHECK-P9: xxspltd 34, 0, 0
106 define <2 x double> @test12(<2 x double>* %p1, <2 x double>* %p2) {
107 %v1 = load <2 x double>, <2 x double>* %p1
108 %v2 = load <2 x double>, <2 x double>* %p2
109 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 2>
112 ; CHECK-LABEL: @test12
113 ; CHECK: lxvd2x 0, 0, 3
114 ; CHECK: lxvd2x 1, 0, 4
115 ; CHECK: xxswapd 0, 0
116 ; CHECK: xxswapd 1, 1
117 ; CHECK: xxpermdi 34, 1, 0, 2
119 ; CHECK-P9-LABEL: @test12
120 ; CHECK-P9: lxv 0, 0(3)
121 ; CHECK-P9: lxv 1, 0(4)
122 ; CHECK-P9: xxpermdi 34, 1, 0, 2
125 define <2 x double> @test13(<2 x double>* %p1, <2 x double>* %p2) {
126 %v1 = load <2 x double>, <2 x double>* %p1
127 %v2 = load <2 x double>, <2 x double>* %p2
128 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 3>
131 ; CHECK-LABEL: @test13
132 ; CHECK: lxvd2x 0, 0, 3
133 ; CHECK: lxvd2x 1, 0, 4
134 ; CHECK: xxswapd 0, 0
135 ; CHECK: xxswapd 1, 1
136 ; CHECK: xxmrghd 34, 1, 0
138 ; CHECK-P9-LABEL: @test13
139 ; CHECK-P9: lxv 0, 0(3)
140 ; CHECK-P9: lxv 1, 0(4)
141 ; CHECK-P9: xxmrghd 34, 1, 0
144 define <2 x double> @test20(<2 x double>* %p1, <2 x double>* %p2) {
145 %v1 = load <2 x double>, <2 x double>* %p1
146 %v2 = load <2 x double>, <2 x double>* %p2
147 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 0>
150 ; CHECK-LABEL: @test20
151 ; CHECK: lxvd2x 0, 0, 3
152 ; CHECK: lxvd2x 1, 0, 4
153 ; CHECK: xxswapd 0, 0
154 ; CHECK: xxswapd 1, 1
155 ; CHECK: xxmrgld 34, 0, 1
157 ; CHECK-P9-LABEL: @test20
158 ; CHECK-P9: lxv 0, 0(3)
159 ; CHECK-P9: lxv 1, 0(4)
160 ; CHECK-P9: xxmrgld 34, 0, 1
163 define <2 x double> @test21(<2 x double>* %p1, <2 x double>* %p2) {
164 %v1 = load <2 x double>, <2 x double>* %p1
165 %v2 = load <2 x double>, <2 x double>* %p2
166 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 1>
169 ; CHECK-LABEL: @test21
170 ; CHECK: lxvd2x 0, 0, 3
171 ; CHECK: lxvd2x 1, 0, 4
172 ; CHECK: xxswapd 0, 0
173 ; CHECK: xxswapd 1, 1
174 ; CHECK: xxpermdi 34, 0, 1, 1
176 ; CHECK-P9-LABEL: @test21
177 ; CHECK-P9: lxv 0, 0(3)
178 ; CHECK-P9: lxv 1, 0(4)
179 ; CHECK-P9: xxpermdi 34, 0, 1, 1
182 define <2 x double> @test22(<2 x double>* %p1, <2 x double>* %p2) {
183 %v1 = load <2 x double>, <2 x double>* %p1
184 %v2 = load <2 x double>, <2 x double>* %p2
185 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 2>
188 ; CHECK-LABEL: @test22
189 ; CHECK: lxvd2x 0, 0, 4
190 ; CHECK: xxspltd 34, 0, 0
192 ; CHECK-P9-LABEL: @test22
193 ; CHECK-P9: lxv 0, 0(4)
194 ; CHECK-P9: xxspltd 34, 0, 1
197 define <2 x double> @test23(<2 x double>* %p1, <2 x double>* %p2) {
198 %v1 = load <2 x double>, <2 x double>* %p1
199 %v2 = load <2 x double>, <2 x double>* %p2
200 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 3>
203 ; CHECK-LABEL: @test23
204 ; CHECK: lxvd2x 0, 0, 4
205 ; CHECK: xxswapd 34, 0
207 ; CHECK-P9-LABEL: @test23
208 ; CHECK-P9: lxv 34, 0(4)
211 define <2 x double> @test30(<2 x double>* %p1, <2 x double>* %p2) {
212 %v1 = load <2 x double>, <2 x double>* %p1
213 %v2 = load <2 x double>, <2 x double>* %p2
214 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 0>
217 ; CHECK-LABEL: @test30
218 ; CHECK: lxvd2x 0, 0, 3
219 ; CHECK: lxvd2x 1, 0, 4
220 ; CHECK: xxswapd 0, 0
221 ; CHECK: xxswapd 1, 1
222 ; CHECK: xxpermdi 34, 0, 1, 2
224 ; CHECK-P9-LABEL: @test30
225 ; CHECK-P9: lxv 0, 0(3)
226 ; CHECK-P9: lxv 1, 0(4)
227 ; CHECK-P9: xxpermdi 34, 0, 1, 2
230 define <2 x double> @test31(<2 x double>* %p1, <2 x double>* %p2) {
231 %v1 = load <2 x double>, <2 x double>* %p1
232 %v2 = load <2 x double>, <2 x double>* %p2
233 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 1>
236 ; CHECK-LABEL: @test31
237 ; CHECK: lxvd2x 0, 0, 3
238 ; CHECK: lxvd2x 1, 0, 4
239 ; CHECK: xxswapd 0, 0
240 ; CHECK: xxswapd 1, 1
241 ; CHECK: xxmrghd 34, 0, 1
243 ; CHECK-P9-LABEL: @test31
244 ; CHECK-P9: lxv 0, 0(3)
245 ; CHECK-P9: lxv 1, 0(4)
246 ; CHECK-P9: xxmrghd 34, 0, 1
249 define <2 x double> @test32(<2 x double>* %p1, <2 x double>* %p2) {
250 %v1 = load <2 x double>, <2 x double>* %p1
251 %v2 = load <2 x double>, <2 x double>* %p2
252 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 2>
255 ; CHECK-LABEL: @test32
256 ; CHECK: lxvd2x 34, 0, 4
258 ; CHECK-P9-LABEL: @test32
259 ; CHECK-P9: lxvd2x 34, 0, 4
262 define <2 x double> @test33(<2 x double>* %p1, <2 x double>* %p2) {
263 %v1 = load <2 x double>, <2 x double>* %p1
264 %v2 = load <2 x double>, <2 x double>* %p2
265 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 3>
268 ; CHECK-LABEL: @test33
269 ; CHECK: lxvd2x 0, 0, 4
270 ; CHECK: xxspltd 34, 0, 1
272 ; CHECK-P9-LABEL: @test33
273 ; CHECK-P9: lxv 0, 0(4)
274 ; CHECK-P9: xxspltd 34, 0, 0