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: lxv 0, 0(3)
89 ; CHECK-P9: xxswapd 34, 0
92 define <2 x double> @test11(<2 x double>* %p1, <2 x double>* %p2) {
93 %v1 = load <2 x double>, <2 x double>* %p1
94 %v2 = load <2 x double>, <2 x double>* %p2
95 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 1>
98 ; CHECK-LABEL: @test11
99 ; CHECK: lxvd2x 0, 0, 3
100 ; CHECK: xxspltd 34, 0, 1
102 ; CHECK-P9-LABEL: @test11
103 ; CHECK-P9: lxv 0, 0(3)
104 ; CHECK-P9: xxspltd 34, 0, 0
107 define <2 x double> @test12(<2 x double>* %p1, <2 x double>* %p2) {
108 %v1 = load <2 x double>, <2 x double>* %p1
109 %v2 = load <2 x double>, <2 x double>* %p2
110 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 2>
113 ; CHECK-LABEL: @test12
114 ; CHECK: lxvd2x 0, 0, 3
115 ; CHECK: lxvd2x 1, 0, 4
116 ; CHECK: xxswapd 0, 0
117 ; CHECK: xxswapd 1, 1
118 ; CHECK: xxpermdi 34, 1, 0, 2
120 ; CHECK-P9-LABEL: @test12
121 ; CHECK-P9: lxv 0, 0(3)
122 ; CHECK-P9: lxv 1, 0(4)
123 ; CHECK-P9: xxpermdi 34, 1, 0, 2
126 define <2 x double> @test13(<2 x double>* %p1, <2 x double>* %p2) {
127 %v1 = load <2 x double>, <2 x double>* %p1
128 %v2 = load <2 x double>, <2 x double>* %p2
129 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 3>
132 ; CHECK-LABEL: @test13
133 ; CHECK: lxvd2x 0, 0, 3
134 ; CHECK: lxvd2x 1, 0, 4
135 ; CHECK: xxswapd 0, 0
136 ; CHECK: xxswapd 1, 1
137 ; CHECK: xxmrghd 34, 1, 0
139 ; CHECK-P9-LABEL: @test13
140 ; CHECK-P9: lxv 0, 0(3)
141 ; CHECK-P9: lxv 1, 0(4)
142 ; CHECK-P9: xxmrghd 34, 1, 0
145 define <2 x double> @test20(<2 x double>* %p1, <2 x double>* %p2) {
146 %v1 = load <2 x double>, <2 x double>* %p1
147 %v2 = load <2 x double>, <2 x double>* %p2
148 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 0>
151 ; CHECK-LABEL: @test20
152 ; CHECK: lxvd2x 0, 0, 3
153 ; CHECK: lxvd2x 1, 0, 4
154 ; CHECK: xxswapd 0, 0
155 ; CHECK: xxswapd 1, 1
156 ; CHECK: xxmrgld 34, 0, 1
158 ; CHECK-P9-LABEL: @test20
159 ; CHECK-P9: lxv 0, 0(3)
160 ; CHECK-P9: lxv 1, 0(4)
161 ; CHECK-P9: xxmrgld 34, 0, 1
164 define <2 x double> @test21(<2 x double>* %p1, <2 x double>* %p2) {
165 %v1 = load <2 x double>, <2 x double>* %p1
166 %v2 = load <2 x double>, <2 x double>* %p2
167 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 1>
170 ; CHECK-LABEL: @test21
171 ; CHECK: lxvd2x 0, 0, 3
172 ; CHECK: lxvd2x 1, 0, 4
173 ; CHECK: xxswapd 0, 0
174 ; CHECK: xxswapd 1, 1
175 ; CHECK: xxpermdi 34, 0, 1, 1
177 ; CHECK-P9-LABEL: @test21
178 ; CHECK-P9: lxv 0, 0(3)
179 ; CHECK-P9: lxv 1, 0(4)
180 ; CHECK-P9: xxpermdi 34, 0, 1, 1
183 define <2 x double> @test22(<2 x double>* %p1, <2 x double>* %p2) {
184 %v1 = load <2 x double>, <2 x double>* %p1
185 %v2 = load <2 x double>, <2 x double>* %p2
186 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 2>
189 ; CHECK-LABEL: @test22
190 ; CHECK: lxvd2x 0, 0, 4
191 ; CHECK: xxspltd 34, 0, 0
193 ; CHECK-P9-LABEL: @test22
194 ; CHECK-P9: lxv 0, 0(4)
195 ; CHECK-P9: xxspltd 34, 0, 1
198 define <2 x double> @test23(<2 x double>* %p1, <2 x double>* %p2) {
199 %v1 = load <2 x double>, <2 x double>* %p1
200 %v2 = load <2 x double>, <2 x double>* %p2
201 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 3>
204 ; CHECK-LABEL: @test23
205 ; CHECK: lxvd2x 0, 0, 4
206 ; CHECK: xxswapd 34, 0
208 ; CHECK-P9-LABEL: @test23
209 ; CHECK-P9: lxv 34, 0(4)
212 define <2 x double> @test30(<2 x double>* %p1, <2 x double>* %p2) {
213 %v1 = load <2 x double>, <2 x double>* %p1
214 %v2 = load <2 x double>, <2 x double>* %p2
215 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 0>
218 ; CHECK-LABEL: @test30
219 ; CHECK: lxvd2x 0, 0, 3
220 ; CHECK: lxvd2x 1, 0, 4
221 ; CHECK: xxswapd 0, 0
222 ; CHECK: xxswapd 1, 1
223 ; CHECK: xxpermdi 34, 0, 1, 2
225 ; CHECK-P9-LABEL: @test30
226 ; CHECK-P9: lxv 0, 0(3)
227 ; CHECK-P9: lxv 1, 0(4)
228 ; CHECK-P9: xxpermdi 34, 0, 1, 2
231 define <2 x double> @test31(<2 x double>* %p1, <2 x double>* %p2) {
232 %v1 = load <2 x double>, <2 x double>* %p1
233 %v2 = load <2 x double>, <2 x double>* %p2
234 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 1>
237 ; CHECK-LABEL: @test31
238 ; CHECK: lxvd2x 0, 0, 3
239 ; CHECK: lxvd2x 1, 0, 4
240 ; CHECK: xxswapd 0, 0
241 ; CHECK: xxswapd 1, 1
242 ; CHECK: xxmrghd 34, 0, 1
244 ; CHECK-P9-LABEL: @test31
245 ; CHECK-P9: lxv 0, 0(3)
246 ; CHECK-P9: lxv 1, 0(4)
247 ; CHECK-P9: xxmrghd 34, 0, 1
250 define <2 x double> @test32(<2 x double>* %p1, <2 x double>* %p2) {
251 %v1 = load <2 x double>, <2 x double>* %p1
252 %v2 = load <2 x double>, <2 x double>* %p2
253 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 2>
256 ; CHECK-LABEL: @test32
257 ; CHECK: lxvd2x 34, 0, 4
259 ; CHECK-P9-LABEL: @test32
260 ; CHECK-P9: lxv 0, 0(4)
261 ; CHECK-P9: xxswapd 34, 0
264 define <2 x double> @test33(<2 x double>* %p1, <2 x double>* %p2) {
265 %v1 = load <2 x double>, <2 x double>* %p1
266 %v2 = load <2 x double>, <2 x double>* %p2
267 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 3>
270 ; CHECK-LABEL: @test33
271 ; CHECK: lxvd2x 0, 0, 4
272 ; CHECK: xxspltd 34, 0, 1
274 ; CHECK-P9-LABEL: @test33
275 ; CHECK-P9: lxv 0, 0(4)
276 ; CHECK-P9: xxspltd 34, 0, 0