1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
4 ; RUN: < %s | FileCheck %s
5 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix -vec-extabi \
6 ; RUN: -mcpu=pwr10 < %s | FileCheck %s -check-prefix=CHECK-AIX
8 define i32 @SplitPromoteVectorTest(i32 %Opc) align 2 {
9 ; CHECK-LABEL: SplitPromoteVectorTest:
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: plxv v2, .LCPI0_0@PCREL(0), 1
12 ; CHECK-NEXT: plxv v4, .LCPI0_1@PCREL(0), 1
13 ; CHECK-NEXT: mtvsrws v3, r3
14 ; CHECK-NEXT: li r5, 12
15 ; CHECK-NEXT: li r8, 0
16 ; CHECK-NEXT: vcmpequw v2, v3, v2
17 ; CHECK-NEXT: plxv v5, .LCPI0_2@PCREL(0), 1
18 ; CHECK-NEXT: vcmpequw v4, v3, v4
19 ; CHECK-NEXT: vcmpequw v5, v3, v5
20 ; CHECK-NEXT: vextubrx r4, r5, v2
21 ; CHECK-NEXT: vextubrx r6, r5, v4
22 ; CHECK-NEXT: or r9, r6, r4
23 ; CHECK-NEXT: li r6, 4
24 ; CHECK-NEXT: vextubrx r4, r8, v5
25 ; CHECK-NEXT: vextubrx r7, r6, v5
26 ; CHECK-NEXT: rlwimi r4, r7, 1, 30, 30
27 ; CHECK-NEXT: li r7, 8
28 ; CHECK-NEXT: vextubrx r10, r7, v5
29 ; CHECK-NEXT: rlwimi r4, r10, 2, 29, 29
30 ; CHECK-NEXT: vextubrx r10, r5, v5
31 ; CHECK-NEXT: plxv v5, .LCPI0_3@PCREL(0), 1
32 ; CHECK-NEXT: rlwimi r4, r10, 3, 28, 28
33 ; CHECK-NEXT: vcmpequw v5, v3, v5
34 ; CHECK-NEXT: vextubrx r10, r8, v5
35 ; CHECK-NEXT: rlwimi r4, r10, 4, 27, 27
36 ; CHECK-NEXT: vextubrx r10, r6, v5
37 ; CHECK-NEXT: rlwimi r4, r10, 5, 26, 26
38 ; CHECK-NEXT: vextubrx r10, r7, v5
39 ; CHECK-NEXT: rlwimi r4, r10, 6, 25, 25
40 ; CHECK-NEXT: vextubrx r10, r5, v5
41 ; CHECK-NEXT: plxv v5, .LCPI0_4@PCREL(0), 1
42 ; CHECK-NEXT: rlwimi r4, r10, 7, 24, 24
43 ; CHECK-NEXT: vcmpequw v5, v3, v5
44 ; CHECK-NEXT: vextubrx r10, r8, v5
45 ; CHECK-NEXT: rlwimi r4, r10, 8, 23, 23
46 ; CHECK-NEXT: vextubrx r10, r6, v5
47 ; CHECK-NEXT: rlwimi r4, r10, 9, 22, 22
48 ; CHECK-NEXT: vextubrx r10, r7, v5
49 ; CHECK-NEXT: rlwimi r4, r10, 10, 21, 21
50 ; CHECK-NEXT: vextubrx r10, r5, v5
51 ; CHECK-NEXT: rlwimi r4, r10, 11, 20, 20
52 ; CHECK-NEXT: vextubrx r10, r8, v4
53 ; CHECK-NEXT: rlwimi r4, r10, 12, 19, 19
54 ; CHECK-NEXT: vextubrx r10, r6, v4
55 ; CHECK-NEXT: rlwimi r4, r10, 13, 18, 18
56 ; CHECK-NEXT: vextubrx r10, r7, v4
57 ; CHECK-NEXT: plxv v4, .LCPI0_5@PCREL(0), 1
58 ; CHECK-NEXT: rlwimi r4, r10, 14, 17, 17
59 ; CHECK-NEXT: rlwimi r4, r9, 15, 0, 16
60 ; CHECK-NEXT: vcmpequw v4, v3, v4
61 ; CHECK-NEXT: vextubrx r10, r8, v4
62 ; CHECK-NEXT: vextubrx r9, r6, v4
63 ; CHECK-NEXT: clrlwi r10, r10, 31
64 ; CHECK-NEXT: rlwimi r10, r9, 1, 30, 30
65 ; CHECK-NEXT: vextubrx r9, r7, v4
66 ; CHECK-NEXT: rlwimi r10, r9, 2, 29, 29
67 ; CHECK-NEXT: vextubrx r9, r5, v4
68 ; CHECK-NEXT: plxv v4, .LCPI0_6@PCREL(0), 1
69 ; CHECK-NEXT: rlwimi r10, r9, 3, 28, 28
70 ; CHECK-NEXT: vcmpequw v4, v3, v4
71 ; CHECK-NEXT: vextubrx r9, r8, v4
72 ; CHECK-NEXT: rlwimi r10, r9, 4, 27, 27
73 ; CHECK-NEXT: vextubrx r9, r6, v4
74 ; CHECK-NEXT: rlwimi r10, r9, 5, 26, 26
75 ; CHECK-NEXT: vextubrx r9, r7, v4
76 ; CHECK-NEXT: rlwimi r10, r9, 6, 25, 25
77 ; CHECK-NEXT: vextubrx r9, r5, v4
78 ; CHECK-NEXT: plxv v4, .LCPI0_7@PCREL(0), 1
79 ; CHECK-NEXT: rlwimi r10, r9, 7, 24, 24
80 ; CHECK-NEXT: vcmpequw v3, v3, v4
81 ; CHECK-NEXT: vextubrx r9, r8, v3
82 ; CHECK-NEXT: vextubrx r5, r5, v3
83 ; CHECK-NEXT: rlwimi r10, r9, 8, 23, 23
84 ; CHECK-NEXT: vextubrx r9, r6, v3
85 ; CHECK-NEXT: rlwimi r10, r9, 9, 22, 22
86 ; CHECK-NEXT: vextubrx r9, r7, v3
87 ; CHECK-NEXT: rlwimi r10, r9, 10, 21, 21
88 ; CHECK-NEXT: rlwimi r10, r5, 11, 20, 20
89 ; CHECK-NEXT: vextubrx r5, r8, v2
90 ; CHECK-NEXT: rlwimi r10, r5, 12, 19, 19
91 ; CHECK-NEXT: vextubrx r5, r6, v2
92 ; CHECK-NEXT: rlwimi r10, r5, 13, 18, 18
93 ; CHECK-NEXT: vextubrx r5, r7, v2
94 ; CHECK-NEXT: rlwimi r10, r5, 14, 17, 17
95 ; CHECK-NEXT: or r4, r4, r10
96 ; CHECK-NEXT: andi. r4, r4, 65535
97 ; CHECK-NEXT: iseleq r3, 0, r3
100 ; CHECK-AIX-LABEL: SplitPromoteVectorTest:
101 ; CHECK-AIX: # %bb.0: # %entry
102 ; CHECK-AIX-NEXT: ld 4, L..C0(2) # %const.0
103 ; CHECK-AIX-NEXT: mtvsrws 34, 3
104 ; CHECK-AIX-NEXT: li 8, 15
105 ; CHECK-AIX-NEXT: li 5, 11
106 ; CHECK-AIX-NEXT: lxv 35, 0(4)
107 ; CHECK-AIX-NEXT: vcmpequw 3, 2, 3
108 ; CHECK-AIX-NEXT: vextublx 4, 8, 3
109 ; CHECK-AIX-NEXT: vextublx 6, 5, 3
110 ; CHECK-AIX-NEXT: clrlwi 4, 4, 31
111 ; CHECK-AIX-NEXT: rlwimi 4, 6, 1, 30, 30
112 ; CHECK-AIX-NEXT: li 6, 7
113 ; CHECK-AIX-NEXT: vextublx 7, 6, 3
114 ; CHECK-AIX-NEXT: rlwimi 4, 7, 2, 29, 29
115 ; CHECK-AIX-NEXT: li 7, 3
116 ; CHECK-AIX-NEXT: vextublx 9, 7, 3
117 ; CHECK-AIX-NEXT: rlwimi 4, 9, 3, 28, 28
118 ; CHECK-AIX-NEXT: ld 9, L..C1(2) # %const.1
119 ; CHECK-AIX-NEXT: lxv 35, 0(9)
120 ; CHECK-AIX-NEXT: vcmpequw 3, 2, 3
121 ; CHECK-AIX-NEXT: vextublx 9, 8, 3
122 ; CHECK-AIX-NEXT: rlwimi 4, 9, 4, 27, 27
123 ; CHECK-AIX-NEXT: vextublx 9, 5, 3
124 ; CHECK-AIX-NEXT: rlwimi 4, 9, 5, 26, 26
125 ; CHECK-AIX-NEXT: vextublx 9, 6, 3
126 ; CHECK-AIX-NEXT: rlwimi 4, 9, 6, 25, 25
127 ; CHECK-AIX-NEXT: vextublx 9, 7, 3
128 ; CHECK-AIX-NEXT: rlwimi 4, 9, 7, 24, 24
129 ; CHECK-AIX-NEXT: ld 9, L..C2(2) # %const.2
130 ; CHECK-AIX-NEXT: lxv 35, 0(9)
131 ; CHECK-AIX-NEXT: vcmpequw 3, 2, 3
132 ; CHECK-AIX-NEXT: vextublx 9, 8, 3
133 ; CHECK-AIX-NEXT: rlwimi 4, 9, 8, 23, 23
134 ; CHECK-AIX-NEXT: vextublx 9, 5, 3
135 ; CHECK-AIX-NEXT: rlwimi 4, 9, 9, 22, 22
136 ; CHECK-AIX-NEXT: vextublx 9, 6, 3
137 ; CHECK-AIX-NEXT: rlwimi 4, 9, 10, 21, 21
138 ; CHECK-AIX-NEXT: vextublx 9, 7, 3
139 ; CHECK-AIX-NEXT: rlwimi 4, 9, 11, 20, 20
140 ; CHECK-AIX-NEXT: ld 9, L..C3(2) # %const.3
141 ; CHECK-AIX-NEXT: lxv 35, 0(9)
142 ; CHECK-AIX-NEXT: vcmpequw 3, 2, 3
143 ; CHECK-AIX-NEXT: vextublx 9, 8, 3
144 ; CHECK-AIX-NEXT: rlwimi 4, 9, 12, 19, 19
145 ; CHECK-AIX-NEXT: vextublx 9, 5, 3
146 ; CHECK-AIX-NEXT: rlwimi 4, 9, 13, 18, 18
147 ; CHECK-AIX-NEXT: vextublx 9, 6, 3
148 ; CHECK-AIX-NEXT: rlwimi 4, 9, 14, 17, 17
149 ; CHECK-AIX-NEXT: vextublx 9, 7, 3
150 ; CHECK-AIX-NEXT: rlwimi 4, 9, 15, 16, 16
151 ; CHECK-AIX-NEXT: ld 9, L..C4(2) # %const.4
152 ; CHECK-AIX-NEXT: lxv 35, 0(9)
153 ; CHECK-AIX-NEXT: vcmpequw 3, 2, 3
154 ; CHECK-AIX-NEXT: vextublx 9, 8, 3
155 ; CHECK-AIX-NEXT: vextublx 10, 5, 3
156 ; CHECK-AIX-NEXT: clrlwi 9, 9, 31
157 ; CHECK-AIX-NEXT: rlwimi 9, 10, 1, 30, 30
158 ; CHECK-AIX-NEXT: vextublx 10, 6, 3
159 ; CHECK-AIX-NEXT: rlwimi 9, 10, 2, 29, 29
160 ; CHECK-AIX-NEXT: vextublx 10, 7, 3
161 ; CHECK-AIX-NEXT: rlwimi 9, 10, 3, 28, 28
162 ; CHECK-AIX-NEXT: ld 10, L..C5(2) # %const.5
163 ; CHECK-AIX-NEXT: lxv 35, 0(10)
164 ; CHECK-AIX-NEXT: vcmpequw 3, 2, 3
165 ; CHECK-AIX-NEXT: vextublx 10, 8, 3
166 ; CHECK-AIX-NEXT: rlwimi 9, 10, 4, 27, 27
167 ; CHECK-AIX-NEXT: vextublx 10, 5, 3
168 ; CHECK-AIX-NEXT: rlwimi 9, 10, 5, 26, 26
169 ; CHECK-AIX-NEXT: vextublx 10, 6, 3
170 ; CHECK-AIX-NEXT: rlwimi 9, 10, 6, 25, 25
171 ; CHECK-AIX-NEXT: vextublx 10, 7, 3
172 ; CHECK-AIX-NEXT: rlwimi 9, 10, 7, 24, 24
173 ; CHECK-AIX-NEXT: ld 10, L..C6(2) # %const.6
174 ; CHECK-AIX-NEXT: lxv 35, 0(10)
175 ; CHECK-AIX-NEXT: vcmpequw 3, 2, 3
176 ; CHECK-AIX-NEXT: vextublx 10, 8, 3
177 ; CHECK-AIX-NEXT: rlwimi 9, 10, 8, 23, 23
178 ; CHECK-AIX-NEXT: vextublx 10, 5, 3
179 ; CHECK-AIX-NEXT: rlwimi 9, 10, 9, 22, 22
180 ; CHECK-AIX-NEXT: vextublx 10, 6, 3
181 ; CHECK-AIX-NEXT: rlwimi 9, 10, 10, 21, 21
182 ; CHECK-AIX-NEXT: vextublx 10, 7, 3
183 ; CHECK-AIX-NEXT: rlwimi 9, 10, 11, 20, 20
184 ; CHECK-AIX-NEXT: ld 10, L..C7(2) # %const.7
185 ; CHECK-AIX-NEXT: lxv 35, 0(10)
186 ; CHECK-AIX-NEXT: vcmpequw 2, 2, 3
187 ; CHECK-AIX-NEXT: vextublx 8, 8, 2
188 ; CHECK-AIX-NEXT: vextublx 5, 5, 2
189 ; CHECK-AIX-NEXT: rlwimi 9, 8, 12, 19, 19
190 ; CHECK-AIX-NEXT: rlwimi 9, 5, 13, 18, 18
191 ; CHECK-AIX-NEXT: vextublx 5, 6, 2
192 ; CHECK-AIX-NEXT: rlwimi 9, 5, 14, 17, 17
193 ; CHECK-AIX-NEXT: vextublx 5, 7, 2
194 ; CHECK-AIX-NEXT: rlwimi 9, 5, 15, 16, 16
195 ; CHECK-AIX-NEXT: or 4, 9, 4
196 ; CHECK-AIX-NEXT: andi. 4, 4, 65535
197 ; CHECK-AIX-NEXT: iseleq 3, 0, 3
198 ; CHECK-AIX-NEXT: blr
200 %0 = insertelement <32 x i32> poison, i32 %Opc, i64 0
201 %shuffle = shufflevector <32 x i32> %0, <32 x i32> poison, <32 x i32> zeroinitializer
202 %1 = icmp eq <32 x i32> %shuffle, <i32 991, i32 888, i32 963, i32 906, i32 944, i32 915, i32 895, i32 952, i32 892, i32 949, i32 974, i32 879, i32 874, i32 943, i32 962, i32 905, i32 914, i32 951, i32 948, i32 894, i32 891, i32 973, i32 878, i32 989, i32 886, i32 987, i32 884, i32 961, i32 904, i32 942, i32 913, i32 893>
203 %2 = bitcast <32 x i1> %1 to i32
204 %3 = icmp ne i32 %2, 0
205 %op.rdx = or i1 %3, false
206 %op.rdx255 = or i1 %op.rdx, false
207 %4 = or i1 %op.rdx255, false
211 %cond = select i1 %7, i32 %Opc, i32 0