llvm.org GIT mirror llvm / f2017db
UpdateTestChecks: ppc32 triple support Summary: Appears identical to powerpc64{,le}. Regenerate test that is being affected by upcoming patch. Reviewers: RKSimon Reviewed By: RKSimon Subscribers: nemanjai, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62339 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361543 91177308-0d34-0410-b5e6-96231b3b80d8 Roman Lebedev 1 year, 6 months ago
2 changed file(s) with 247 addition(s) and 56 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -mcpu=g3 | FileCheck %s --check-prefixes=ALL,G3
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -mcpu=g5 | FileCheck %s --check-prefixes=ALL,G5
3
4 ; Test that vectors are scalarized/lowered correctly.
1 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -mcpu=g3 | \
2 ; RUN: grep stfs | count 4
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -mcpu=g5 -o %t
4 ; RUN: grep vspltw %t | count 2
5 ; RUN: grep vsplti %t | count 3
6 ; RUN: grep vsplth %t | count 1
7
8 %f4 = type <4 x float>
9 %i4 = type <4 x i32>
5
6 %f4 = type <4 x float>
7 %i4 = type <4 x i32>
108
119 define void @splat(%f4* %P, %f4* %Q, float %X) nounwind {
12 %tmp = insertelement %f4 undef, float %X, i32 0 ; <%f4> [#uses=1]
13 %tmp2 = insertelement %f4 %tmp, float %X, i32 1 ; <%f4> [#uses=1]
14 %tmp4 = insertelement %f4 %tmp2, float %X, i32 2 ; <%f4> [#uses=1]
15 %tmp6 = insertelement %f4 %tmp4, float %X, i32 3 ; <%f4> [#uses=1]
16 %q = load %f4, %f4* %Q ; <%f4> [#uses=1]
17 %R = fadd %f4 %q, %tmp6 ; <%f4> [#uses=1]
18 store %f4 %R, %f4* %P
19 ret void
10 ; G3-LABEL: splat:
11 ; G3: # %bb.0:
12 ; G3-NEXT: lfs 0, 0(4)
13 ; G3-NEXT: lfs 2, 8(4)
14 ; G3-NEXT: lfs 3, 4(4)
15 ; G3-NEXT: lfs 4, 12(4)
16 ; G3-NEXT: fadds 0, 0, 1
17 ; G3-NEXT: fadds 2, 2, 1
18 ; G3-NEXT: fadds 3, 3, 1
19 ; G3-NEXT: fadds 1, 4, 1
20 ; G3-NEXT: stfs 1, 12(3)
21 ; G3-NEXT: stfs 2, 8(3)
22 ; G3-NEXT: stfs 3, 4(3)
23 ; G3-NEXT: stfs 0, 0(3)
24 ; G3-NEXT: blr
25 ;
26 ; G5-LABEL: splat:
27 ; G5: # %bb.0:
28 ; G5-NEXT: stwu 1, -32(1)
29 ; G5-NEXT: stfs 1, 16(1)
30 ; G5-NEXT: addi 5, 1, 16
31 ; G5-NEXT: lvx 2, 0, 5
32 ; G5-NEXT: lvx 3, 0, 4
33 ; G5-NEXT: vspltw 2, 2, 0
34 ; G5-NEXT: vaddfp 2, 3, 2
35 ; G5-NEXT: stvx 2, 0, 3
36 ; G5-NEXT: addi 1, 1, 32
37 ; G5-NEXT: blr
38 %tmp = insertelement %f4 undef, float %X, i32 0 ; <%f4> [#uses=1]
39 %tmp2 = insertelement %f4 %tmp, float %X, i32 1 ; <%f4> [#uses=1]
40 %tmp4 = insertelement %f4 %tmp2, float %X, i32 2 ; <%f4> [#uses=1]
41 %tmp6 = insertelement %f4 %tmp4, float %X, i32 3 ; <%f4> [#uses=1]
42 %q = load %f4, %f4* %Q ; <%f4> [#uses=1]
43 %R = fadd %f4 %q, %tmp6 ; <%f4> [#uses=1]
44 store %f4 %R, %f4* %P
45 ret void
2046 }
2147
2248 define void @splat_i4(%i4* %P, %i4* %Q, i32 %X) nounwind {
23 %tmp = insertelement %i4 undef, i32 %X, i32 0 ; <%i4> [#uses=1]
24 %tmp2 = insertelement %i4 %tmp, i32 %X, i32 1 ; <%i4> [#uses=1]
25 %tmp4 = insertelement %i4 %tmp2, i32 %X, i32 2 ; <%i4> [#uses=1]
26 %tmp6 = insertelement %i4 %tmp4, i32 %X, i32 3 ; <%i4> [#uses=1]
27 %q = load %i4, %i4* %Q ; <%i4> [#uses=1]
28 %R = add %i4 %q, %tmp6 ; <%i4> [#uses=1]
29 store %i4 %R, %i4* %P
30 ret void
49 ; G3-LABEL: splat_i4:
50 ; G3: # %bb.0:
51 ; G3-NEXT: lwz 6, 0(4)
52 ; G3-NEXT: lwz 7, 8(4)
53 ; G3-NEXT: lwz 8, 4(4)
54 ; G3-NEXT: lwz 4, 12(4)
55 ; G3-NEXT: add 6, 6, 5
56 ; G3-NEXT: add 8, 8, 5
57 ; G3-NEXT: add 7, 7, 5
58 ; G3-NEXT: add 4, 4, 5
59 ; G3-NEXT: stw 4, 12(3)
60 ; G3-NEXT: stw 7, 8(3)
61 ; G3-NEXT: stw 8, 4(3)
62 ; G3-NEXT: stw 6, 0(3)
63 ; G3-NEXT: blr
64 ;
65 ; G5-LABEL: splat_i4:
66 ; G5: # %bb.0:
67 ; G5-NEXT: stwu 1, -32(1)
68 ; G5-NEXT: stw 5, 16(1)
69 ; G5-NEXT: addi 5, 1, 16
70 ; G5-NEXT: lvx 2, 0, 5
71 ; G5-NEXT: lvx 3, 0, 4
72 ; G5-NEXT: vspltw 2, 2, 0
73 ; G5-NEXT: vadduwm 2, 3, 2
74 ; G5-NEXT: stvx 2, 0, 3
75 ; G5-NEXT: addi 1, 1, 32
76 ; G5-NEXT: blr
77 %tmp = insertelement %i4 undef, i32 %X, i32 0 ; <%i4> [#uses=1]
78 %tmp2 = insertelement %i4 %tmp, i32 %X, i32 1 ; <%i4> [#uses=1]
79 %tmp4 = insertelement %i4 %tmp2, i32 %X, i32 2 ; <%i4> [#uses=1]
80 %tmp6 = insertelement %i4 %tmp4, i32 %X, i32 3 ; <%i4> [#uses=1]
81 %q = load %i4, %i4* %Q ; <%i4> [#uses=1]
82 %R = add %i4 %q, %tmp6 ; <%i4> [#uses=1]
83 store %i4 %R, %i4* %P
84 ret void
3185 }
3286
3387 define void @splat_imm_i32(%i4* %P, %i4* %Q, i32 %X) nounwind {
34 %q = load %i4, %i4* %Q ; <%i4> [#uses=1]
35 %R = add %i4 %q, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <%i4> [#uses=1]
36 store %i4 %R, %i4* %P
37 ret void
88 ; G3-LABEL: splat_imm_i32:
89 ; G3: # %bb.0:
90 ; G3-NEXT: lwz 5, 0(4)
91 ; G3-NEXT: lwz 6, 8(4)
92 ; G3-NEXT: lwz 7, 4(4)
93 ; G3-NEXT: lwz 4, 12(4)
94 ; G3-NEXT: addi 5, 5, -1
95 ; G3-NEXT: addi 7, 7, -1
96 ; G3-NEXT: addi 6, 6, -1
97 ; G3-NEXT: addi 4, 4, -1
98 ; G3-NEXT: stw 4, 12(3)
99 ; G3-NEXT: stw 6, 8(3)
100 ; G3-NEXT: stw 7, 4(3)
101 ; G3-NEXT: stw 5, 0(3)
102 ; G3-NEXT: blr
103 ;
104 ; G5-LABEL: splat_imm_i32:
105 ; G5: # %bb.0:
106 ; G5-NEXT: lvx 2, 0, 4
107 ; G5-NEXT: vspltisb 3, -1
108 ; G5-NEXT: vadduwm 2, 2, 3
109 ; G5-NEXT: stvx 2, 0, 3
110 ; G5-NEXT: blr
111 %q = load %i4, %i4* %Q ; <%i4> [#uses=1]
112 %R = add %i4 %q, < i32 -1, i32 -1, i32 -1, i32 -1 > ; <%i4> [#uses=1]
113 store %i4 %R, %i4* %P
114 ret void
38115 }
39116
40117 define void @splat_imm_i16(%i4* %P, %i4* %Q, i32 %X) nounwind {
41 %q = load %i4, %i4* %Q ; <%i4> [#uses=1]
42 %R = add %i4 %q, < i32 65537, i32 65537, i32 65537, i32 65537 > ; <%i4> [#uses=1]
43 store %i4 %R, %i4* %P
44 ret void
118 ; G3-LABEL: splat_imm_i16:
119 ; G3: # %bb.0:
120 ; G3-NEXT: lwz 5, 0(4)
121 ; G3-NEXT: lwz 6, 8(4)
122 ; G3-NEXT: lwz 7, 4(4)
123 ; G3-NEXT: lwz 4, 12(4)
124 ; G3-NEXT: addi 5, 5, 1
125 ; G3-NEXT: addi 7, 7, 1
126 ; G3-NEXT: addi 6, 6, 1
127 ; G3-NEXT: addi 4, 4, 1
128 ; G3-NEXT: addis 5, 5, 1
129 ; G3-NEXT: addis 7, 7, 1
130 ; G3-NEXT: addis 6, 6, 1
131 ; G3-NEXT: addis 4, 4, 1
132 ; G3-NEXT: stw 4, 12(3)
133 ; G3-NEXT: stw 6, 8(3)
134 ; G3-NEXT: stw 7, 4(3)
135 ; G3-NEXT: stw 5, 0(3)
136 ; G3-NEXT: blr
137 ;
138 ; G5-LABEL: splat_imm_i16:
139 ; G5: # %bb.0:
140 ; G5-NEXT: lvx 2, 0, 4
141 ; G5-NEXT: vspltish 3, 1
142 ; G5-NEXT: vadduwm 2, 2, 3
143 ; G5-NEXT: stvx 2, 0, 3
144 ; G5-NEXT: blr
145 %q = load %i4, %i4* %Q ; <%i4> [#uses=1]
146 %R = add %i4 %q, < i32 65537, i32 65537, i32 65537, i32 65537 > ; <%i4> [#uses=1]
147 store %i4 %R, %i4* %P
148 ret void
45149 }
46150
47151 define void @splat_h(i16 %tmp, <16 x i8>* %dst) nounwind {
48 %tmp.upgrd.1 = insertelement <8 x i16> undef, i16 %tmp, i32 0
49 %tmp72 = insertelement <8 x i16> %tmp.upgrd.1, i16 %tmp, i32 1
50 %tmp73 = insertelement <8 x i16> %tmp72, i16 %tmp, i32 2
51 %tmp74 = insertelement <8 x i16> %tmp73, i16 %tmp, i32 3
52 %tmp75 = insertelement <8 x i16> %tmp74, i16 %tmp, i32 4
53 %tmp76 = insertelement <8 x i16> %tmp75, i16 %tmp, i32 5
54 %tmp77 = insertelement <8 x i16> %tmp76, i16 %tmp, i32 6
55 %tmp78 = insertelement <8 x i16> %tmp77, i16 %tmp, i32 7
56 %tmp78.upgrd.2 = bitcast <8 x i16> %tmp78 to <16 x i8>
57 store <16 x i8> %tmp78.upgrd.2, <16 x i8>* %dst
58 ret void
152 ; G3-LABEL: splat_h:
153 ; G3: # %bb.0:
154 ; G3-NEXT: sth 3, 14(4)
155 ; G3-NEXT: sth 3, 12(4)
156 ; G3-NEXT: sth 3, 10(4)
157 ; G3-NEXT: sth 3, 8(4)
158 ; G3-NEXT: sth 3, 6(4)
159 ; G3-NEXT: sth 3, 4(4)
160 ; G3-NEXT: sth 3, 2(4)
161 ; G3-NEXT: sth 3, 0(4)
162 ; G3-NEXT: blr
163 ;
164 ; G5-LABEL: splat_h:
165 ; G5: # %bb.0:
166 ; G5-NEXT: stwu 1, -32(1)
167 ; G5-NEXT: sth 3, 16(1)
168 ; G5-NEXT: addi 3, 1, 16
169 ; G5-NEXT: lvx 2, 0, 3
170 ; G5-NEXT: vsplth 2, 2, 0
171 ; G5-NEXT: stvx 2, 0, 4
172 ; G5-NEXT: addi 1, 1, 32
173 ; G5-NEXT: blr
174 %tmp.upgrd.1 = insertelement <8 x i16> undef, i16 %tmp, i32 0
175 %tmp72 = insertelement <8 x i16> %tmp.upgrd.1, i16 %tmp, i32 1
176 %tmp73 = insertelement <8 x i16> %tmp72, i16 %tmp, i32 2
177 %tmp74 = insertelement <8 x i16> %tmp73, i16 %tmp, i32 3
178 %tmp75 = insertelement <8 x i16> %tmp74, i16 %tmp, i32 4
179 %tmp76 = insertelement <8 x i16> %tmp75, i16 %tmp, i32 5
180 %tmp77 = insertelement <8 x i16> %tmp76, i16 %tmp, i32 6
181 %tmp78 = insertelement <8 x i16> %tmp77, i16 %tmp, i32 7
182 %tmp78.upgrd.2 = bitcast <8 x i16> %tmp78 to <16 x i8>
183 store <16 x i8> %tmp78.upgrd.2, <16 x i8>* %dst
184 ret void
59185 }
60186
61187 define void @spltish(<16 x i8>* %A, <16 x i8>* %B) nounwind {
62 %tmp = load <16 x i8>, <16 x i8>* %B ; <<16 x i8>> [#uses=1]
63 %tmp.s = bitcast <16 x i8> %tmp to <16 x i8> ; <<16 x i8>> [#uses=1]
64 %tmp4 = sub <16 x i8> %tmp.s, bitcast (<8 x i16> < i16 15, i16 15, i16 15, i16 15, i16 15, i16
65 15, i16 15, i16 15 > to <16 x i8>) ; <<16 x i8>> [#uses=1]
66 %tmp4.u = bitcast <16 x i8> %tmp4 to <16 x i8> ; <<16 x i8>> [#uses=1]
67 store <16 x i8> %tmp4.u, <16 x i8>* %A
68 ret void
69 }
70
188 ; G3-LABEL: spltish:
189 ; G3: # %bb.0:
190 ; G3-NEXT: stwu 1, -48(1)
191 ; G3-NEXT: stw 25, 20(1) # 4-byte Folded Spill
192 ; G3-NEXT: stw 26, 24(1) # 4-byte Folded Spill
193 ; G3-NEXT: stw 27, 28(1) # 4-byte Folded Spill
194 ; G3-NEXT: stw 28, 32(1) # 4-byte Folded Spill
195 ; G3-NEXT: stw 29, 36(1) # 4-byte Folded Spill
196 ; G3-NEXT: stw 30, 40(1) # 4-byte Folded Spill
197 ; G3-NEXT: lbz 5, 5(4)
198 ; G3-NEXT: lbz 6, 3(4)
199 ; G3-NEXT: lbz 7, 1(4)
200 ; G3-NEXT: lbz 8, 0(4)
201 ; G3-NEXT: lbz 9, 2(4)
202 ; G3-NEXT: lbz 10, 4(4)
203 ; G3-NEXT: lbz 11, 6(4)
204 ; G3-NEXT: lbz 12, 8(4)
205 ; G3-NEXT: lbz 0, 10(4)
206 ; G3-NEXT: addi 7, 7, -15
207 ; G3-NEXT: lbz 30, 12(4)
208 ; G3-NEXT: lbz 29, 14(4)
209 ; G3-NEXT: lbz 28, 15(4)
210 ; G3-NEXT: lbz 27, 13(4)
211 ; G3-NEXT: lbz 26, 11(4)
212 ; G3-NEXT: lbz 25, 9(4)
213 ; G3-NEXT: addi 6, 6, -15
214 ; G3-NEXT: lbz 4, 7(4)
215 ; G3-NEXT: addi 5, 5, -15
216 ; G3-NEXT: addi 25, 25, -15
217 ; G3-NEXT: addi 26, 26, -15
218 ; G3-NEXT: addi 4, 4, -15
219 ; G3-NEXT: addi 27, 27, -15
220 ; G3-NEXT: addi 28, 28, -15
221 ; G3-NEXT: stb 29, 14(3)
222 ; G3-NEXT: stb 30, 12(3)
223 ; G3-NEXT: stb 0, 10(3)
224 ; G3-NEXT: stb 12, 8(3)
225 ; G3-NEXT: stb 11, 6(3)
226 ; G3-NEXT: stb 10, 4(3)
227 ; G3-NEXT: stb 9, 2(3)
228 ; G3-NEXT: stb 8, 0(3)
229 ; G3-NEXT: stb 28, 15(3)
230 ; G3-NEXT: stb 27, 13(3)
231 ; G3-NEXT: stb 26, 11(3)
232 ; G3-NEXT: stb 25, 9(3)
233 ; G3-NEXT: stb 4, 7(3)
234 ; G3-NEXT: stb 5, 5(3)
235 ; G3-NEXT: stb 6, 3(3)
236 ; G3-NEXT: stb 7, 1(3)
237 ; G3-NEXT: lwz 30, 40(1) # 4-byte Folded Reload
238 ; G3-NEXT: lwz 29, 36(1) # 4-byte Folded Reload
239 ; G3-NEXT: lwz 28, 32(1) # 4-byte Folded Reload
240 ; G3-NEXT: lwz 27, 28(1) # 4-byte Folded Reload
241 ; G3-NEXT: lwz 26, 24(1) # 4-byte Folded Reload
242 ; G3-NEXT: lwz 25, 20(1) # 4-byte Folded Reload
243 ; G3-NEXT: addi 1, 1, 48
244 ; G3-NEXT: blr
245 ;
246 ; G5-LABEL: spltish:
247 ; G5: # %bb.0:
248 ; G5-NEXT: lvx 2, 0, 4
249 ; G5-NEXT: vspltish 3, 15
250 ; G5-NEXT: vsububm 2, 2, 3
251 ; G5-NEXT: stvx 2, 0, 3
252 ; G5-NEXT: blr
253 %tmp = load <16 x i8>, <16 x i8>* %B ; <<16 x i8>> [#uses=1]
254 %tmp.s = bitcast <16 x i8> %tmp to <16 x i8> ; <<16 x i8>> [#uses=1]
255 %tmp4 = sub <16 x i8> %tmp.s, bitcast (<8 x i16> < i16 15, i16 15, i16 15, i16 15, i16 15, i16
256 15, i16 15, i16 15 > to <16 x i8>) ; <<16 x i8>> [#uses=1]
257 %tmp4.u = bitcast <16 x i8> %tmp4 to <16 x i8> ; <<16 x i8>> [#uses=1]
258 store <16 x i8> %tmp4.u, <16 x i8>* %A
259 ret void
260 }
153153 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
154154 return asm
155155
156 def scrub_asm_powerpc64(asm, args):
156 def scrub_asm_powerpc(asm, args):
157157 # Scrub runs of whitespace out of the assembly, but leave the leading
158158 # whitespace in place.
159159 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm)
260260 'armv7eb': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),
261261 'armv8a': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),
262262 'mips': (scrub_asm_mips, ASM_FUNCTION_MIPS_RE),
263 'powerpc64': (scrub_asm_powerpc64, ASM_FUNCTION_PPC_RE),
264 'powerpc64le': (scrub_asm_powerpc64, ASM_FUNCTION_PPC_RE),
263 'ppc32': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE),
264 'powerpc64': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE),
265 'powerpc64le': (scrub_asm_powerpc, ASM_FUNCTION_PPC_RE),
265266 'riscv32': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
266267 'riscv64': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
267268 'sparc': (scrub_asm_sparc, ASM_FUNCTION_SPARC_RE),