1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -mattr=+altivec -mattr=-vsx -mcpu=pwr7 | FileCheck %s
3 define void @VPKUHUM_xy(<16 x i8>* %A, <16 x i8>* %B) {
6 %tmp = load <16 x i8>, <16 x i8>* %A
7 %tmp2 = load <16 x i8>, <16 x i8>* %B
8 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2, <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16, i32 18, i32 20, i32 22, i32 24, i32 26, i32 28, i32 30>
9 ; CHECK: lvx [[REG1:[0-9]+]]
10 ; CHECK: lvx [[REG2:[0-9]+]]
11 ; CHECK: vpkuhum [[REG3:[0-9]+]], [[REG2]], [[REG1]]
12 store <16 x i8> %tmp3, <16 x i8>* %A
16 define void @VPKUHUM_xx(<16 x i8>* %A) {
19 %tmp = load <16 x i8>, <16 x i8>* %A
20 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
22 store <16 x i8> %tmp2, <16 x i8>* %A
26 define void @VPKUWUM_xy(<16 x i8>* %A, <16 x i8>* %B) {
29 %tmp = load <16 x i8>, <16 x i8>* %A
30 %tmp2 = load <16 x i8>, <16 x i8>* %B
31 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2, <16 x i32> <i32 0, i32 1, i32 4, i32 5, i32 8, i32 9, i32 12, i32 13, i32 16, i32 17, i32 20, i32 21, i32 24, i32 25, i32 28, i32 29>
32 ; CHECK: lvx [[REG1:[0-9]+]]
33 ; CHECK: lvx [[REG2:[0-9]+]]
34 ; CHECK: vpkuwum [[REG3:[0-9]+]], [[REG2]], [[REG1]]
35 store <16 x i8> %tmp3, <16 x i8>* %A
39 define void @VPKUWUM_xx(<16 x i8>* %A) {
42 %tmp = load <16 x i8>, <16 x i8>* %A
43 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 0, i32 1, i32 4, i32 5, i32 8, i32 9, i32 12, i32 13, i32 0, i32 1, i32 4, i32 5, i32 8, i32 9, i32 12, i32 13>
45 store <16 x i8> %tmp2, <16 x i8>* %A
49 define void @VMRGLB_xy(<16 x i8>* %A, <16 x i8>* %B) {
52 %tmp = load <16 x i8>, <16 x i8>* %A
53 %tmp2 = load <16 x i8>, <16 x i8>* %B
54 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2, <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23>
55 ; CHECK: lvx [[REG1:[0-9]+]]
56 ; CHECK: lvx [[REG2:[0-9]+]]
57 ; CHECK: vmrglb [[REG3:[0-9]+]], [[REG2]], [[REG1]]
58 store <16 x i8> %tmp3, <16 x i8>* %A
62 define void @VMRGLB_xx(<16 x i8>* %A) {
65 %tmp = load <16 x i8>, <16 x i8>* %A
66 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3, i32 4, i32 4, i32 5, i32 5, i32 6, i32 6, i32 7, i32 7>
68 store <16 x i8> %tmp2, <16 x i8>* %A
72 define void @VMRGHB_xy(<16 x i8>* %A, <16 x i8>* %B) {
75 %tmp = load <16 x i8>, <16 x i8>* %A
76 %tmp2 = load <16 x i8>, <16 x i8>* %B
77 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2, <16 x i32> <i32 8, i32 24, i32 9, i32 25, i32 10, i32 26, i32 11, i32 27, i32 12, i32 28, i32 13, i32 29, i32 14, i32 30, i32 15, i32 31>
78 ; CHECK: lvx [[REG1:[0-9]+]]
79 ; CHECK: lvx [[REG2:[0-9]+]]
80 ; CHECK: vmrghb [[REG3:[0-9]+]], [[REG2]], [[REG1]]
81 store <16 x i8> %tmp3, <16 x i8>* %A
85 define void @VMRGHB_xx(<16 x i8>* %A) {
88 %tmp = load <16 x i8>, <16 x i8>* %A
89 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 8, i32 8, i32 9, i32 9, i32 10, i32 10, i32 11, i32 11, i32 12, i32 12, i32 13, i32 13, i32 14, i32 14, i32 15, i32 15>
91 store <16 x i8> %tmp2, <16 x i8>* %A
95 define void @VMRGLH_xy(<16 x i8>* %A, <16 x i8>* %B) {
98 %tmp = load <16 x i8>, <16 x i8>* %A
99 %tmp2 = load <16 x i8>, <16 x i8>* %B
100 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2, <16 x i32> <i32 0, i32 1, i32 16, i32 17, i32 2, i32 3, i32 18, i32 19, i32 4, i32 5, i32 20, i32 21, i32 6, i32 7, i32 22, i32 23>
101 ; CHECK: lvx [[REG1:[0-9]+]]
102 ; CHECK: lvx [[REG2:[0-9]+]]
103 ; CHECK: vmrglh [[REG3:[0-9]+]], [[REG2]], [[REG1]]
104 store <16 x i8> %tmp3, <16 x i8>* %A
108 define void @VMRGLH_xx(<16 x i8>* %A) {
111 %tmp = load <16 x i8>, <16 x i8>* %A
112 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 2, i32 3, i32 2, i32 3, i32 4, i32 5, i32 4, i32 5, i32 6, i32 7, i32 6, i32 7>
114 store <16 x i8> %tmp2, <16 x i8>* %A
118 define void @VMRGHH_xy(<16 x i8>* %A, <16 x i8>* %B) {
121 %tmp = load <16 x i8>, <16 x i8>* %A
122 %tmp2 = load <16 x i8>, <16 x i8>* %B
123 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2, <16 x i32> <i32 8, i32 9, i32 24, i32 25, i32 10, i32 11, i32 26, i32 27, i32 12, i32 13, i32 28, i32 29, i32 14, i32 15, i32 30, i32 31>
124 ; CHECK: lvx [[REG1:[0-9]+]]
125 ; CHECK: lvx [[REG2:[0-9]+]]
126 ; CHECK: vmrghh [[REG3:[0-9]+]], [[REG2]], [[REG1]]
127 store <16 x i8> %tmp3, <16 x i8>* %A
131 define void @VMRGHH_xx(<16 x i8>* %A) {
134 %tmp = load <16 x i8>, <16 x i8>* %A
135 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 8, i32 9, i32 8, i32 9, i32 10, i32 11, i32 10, i32 11, i32 12, i32 13, i32 12, i32 13, i32 14, i32 15, i32 14, i32 15>
137 store <16 x i8> %tmp2, <16 x i8>* %A
141 define void @VMRGLW_xy(<16 x i8>* %A, <16 x i8>* %B) {
144 %tmp = load <16 x i8>, <16 x i8>* %A
145 %tmp2 = load <16 x i8>, <16 x i8>* %B
146 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 16, i32 17, i32 18, i32 19, i32 4, i32 5, i32 6, i32 7, i32 20, i32 21, i32 22, i32 23>
147 ; CHECK: lvx [[REG1:[0-9]+]]
148 ; CHECK: lvx [[REG2:[0-9]+]]
149 ; CHECK: vmrglw [[REG3:[0-9]+]], [[REG2]], [[REG1]]
150 store <16 x i8> %tmp3, <16 x i8>* %A
154 define void @VMRGLW_xx(<16 x i8>* %A) {
157 %tmp = load <16 x i8>, <16 x i8>* %A
158 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 4, i32 5, i32 6, i32 7>
160 store <16 x i8> %tmp2, <16 x i8>* %A
164 define void @VMRGHW_xy(<16 x i8>* %A, <16 x i8>* %B) {
167 %tmp = load <16 x i8>, <16 x i8>* %A
168 %tmp2 = load <16 x i8>, <16 x i8>* %B
169 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2, <16 x i32> <i32 8, i32 9, i32 10, i32 11, i32 24, i32 25, i32 26, i32 27, i32 12, i32 13, i32 14, i32 15, i32 28, i32 29, i32 30, i32 31>
170 ; CHECK: lvx [[REG1:[0-9]+]]
171 ; CHECK: lvx [[REG2:[0-9]+]]
172 ; CHECK: vmrghw [[REG3:[0-9]+]], [[REG2]], [[REG1]]
173 store <16 x i8> %tmp3, <16 x i8>* %A
177 define void @VMRGHW_xx(<16 x i8>* %A) {
180 %tmp = load <16 x i8>, <16 x i8>* %A
181 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 8, i32 9, i32 10, i32 11, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 12, i32 13, i32 14, i32 15>
183 store <16 x i8> %tmp2, <16 x i8>* %A
187 define void @VSLDOI_xy(<16 x i8>* %A, <16 x i8>* %B) {
190 %tmp = load <16 x i8>, <16 x i8>* %A
191 %tmp2 = load <16 x i8>, <16 x i8>* %B
192 %tmp3 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp2, <16 x i32> <i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27>
193 ; CHECK: lvx [[REG1:[0-9]+]]
194 ; CHECK: lvx [[REG2:[0-9]+]]
195 ; CHECK: vsldoi [[REG3:[0-9]+]], [[REG2]], [[REG1]], 4
196 store <16 x i8> %tmp3, <16 x i8>* %A
200 define void @VSLDOI_xx(<16 x i8>* %A) {
203 %tmp = load <16 x i8>, <16 x i8>* %A
204 %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 12, i32 13, i32 14, i32 15, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11>
205 ; CHECK: vsldoi {{[0-9]+}}, [[REG1:[0-9]+]], [[REG1]], 4
206 store <16 x i8> %tmp2, <16 x i8>* %A