1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -O0 -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \
3 ; RUN: -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s \
4 ; RUN: --check-prefix=SMALL64-O0
5 ; RUN: llc -O0 -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \
6 ; RUN: -mtriple powerpc64-ibm-aix-xcoff --code-model=large < %s \
7 ; RUN: | FileCheck %s --check-prefix=LARGE64-O0
8 ; RUN: llc -O0 -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \
9 ; RUN: -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s \
10 ; RUN: --check-prefix=SMALL32-O0
11 ; RUN: llc -O0 -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \
12 ; RUN: -mtriple powerpc-ibm-aix-xcoff --code-model=large < %s \
13 ; RUN: | FileCheck %s --check-prefix=LARGE32-O0
14 ; RUN: llc -O0 -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \
15 ; RUN: -mtriple powerpc64-ibm-aix-xcoff -mattr=+aix-small-local-exec-tls < %s \
16 ; RUN: | FileCheck %s --check-prefix=SMALL-LOCAL-EXEC-SMALLCM64
17 ; RUN: llc -O0 -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \
18 ; RUN: -mtriple powerpc64-ibm-aix-xcoff --code-model=large \
19 ; RUN: -mattr=+aix-small-local-exec-tls < %s | FileCheck %s \
20 ; RUN: --check-prefix=SMALL-LOCAL-EXEC-LARGECM64
22 @TLInt = internal thread_local(localexec) global i32 0, align 4
23 @TLLongLong = internal thread_local(localexec) global i64 0, align 8
24 @TLDouble = internal thread_local(localexec) global double 0.000000e+00, align 8
25 @TLFloat = internal thread_local(localexec) global float 0.000000e+00, align 4
26 declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1
28 define void @storeInt(i32 noundef %x) {
29 ; SMALL64-O0-LABEL: storeInt:
30 ; SMALL64-O0: # %bb.0: # %entry
31 ; SMALL64-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
32 ; SMALL64-O0-NEXT: ld r4, L..C0(r2) # target-flags(ppc-tprel) @TLInt
33 ; SMALL64-O0-NEXT: add r4, r13, r4
34 ; SMALL64-O0-NEXT: stw r3, 0(r4)
35 ; SMALL64-O0-NEXT: blr
37 ; LARGE64-O0-LABEL: storeInt:
38 ; LARGE64-O0: # %bb.0: # %entry
39 ; LARGE64-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
40 ; LARGE64-O0-NEXT: addis r4, L..C0@u(r2)
41 ; LARGE64-O0-NEXT: ld r4, L..C0@l(r4)
42 ; LARGE64-O0-NEXT: add r4, r13, r4
43 ; LARGE64-O0-NEXT: stw r3, 0(r4)
44 ; LARGE64-O0-NEXT: blr
46 ; SMALL32-O0-LABEL: storeInt:
47 ; SMALL32-O0: # %bb.0: # %entry
48 ; SMALL32-O0-NEXT: mflr r0
49 ; SMALL32-O0-NEXT: stwu r1, -32(r1)
50 ; SMALL32-O0-NEXT: stw r0, 40(r1)
51 ; SMALL32-O0-NEXT: stw r3, 28(r1) # 4-byte Folded Spill
52 ; SMALL32-O0-NEXT: lwz r5, L..C0(r2) # target-flags(ppc-tprel) @TLInt
53 ; SMALL32-O0-NEXT: bla .__get_tpointer[PR]
54 ; SMALL32-O0-NEXT: mr r4, r3
55 ; SMALL32-O0-NEXT: lwz r3, 28(r1) # 4-byte Folded Reload
56 ; SMALL32-O0-NEXT: add r4, r4, r5
57 ; SMALL32-O0-NEXT: stw r3, 0(r4)
58 ; SMALL32-O0-NEXT: addi r1, r1, 32
59 ; SMALL32-O0-NEXT: lwz r0, 8(r1)
60 ; SMALL32-O0-NEXT: mtlr r0
61 ; SMALL32-O0-NEXT: blr
63 ; LARGE32-O0-LABEL: storeInt:
64 ; LARGE32-O0: # %bb.0: # %entry
65 ; LARGE32-O0-NEXT: mflr r0
66 ; LARGE32-O0-NEXT: stwu r1, -32(r1)
67 ; LARGE32-O0-NEXT: stw r0, 40(r1)
68 ; LARGE32-O0-NEXT: stw r3, 28(r1) # 4-byte Folded Spill
69 ; LARGE32-O0-NEXT: addis r3, L..C0@u(r2)
70 ; LARGE32-O0-NEXT: lwz r5, L..C0@l(r3)
71 ; LARGE32-O0-NEXT: bla .__get_tpointer[PR]
72 ; LARGE32-O0-NEXT: mr r4, r3
73 ; LARGE32-O0-NEXT: lwz r3, 28(r1) # 4-byte Folded Reload
74 ; LARGE32-O0-NEXT: add r4, r4, r5
75 ; LARGE32-O0-NEXT: stw r3, 0(r4)
76 ; LARGE32-O0-NEXT: addi r1, r1, 32
77 ; LARGE32-O0-NEXT: lwz r0, 8(r1)
78 ; LARGE32-O0-NEXT: mtlr r0
79 ; LARGE32-O0-NEXT: blr
81 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: storeInt:
82 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
83 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: # kill: def $r3 killed $r3 killed $x3
84 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: la r4, TLInt[UL]@le(r13)
85 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: stw r3, 0(r4)
86 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
88 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: storeInt:
89 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
90 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: # kill: def $r3 killed $r3 killed $x3
91 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: la r4, TLInt[UL]@le(r13)
92 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: stw r3, 0(r4)
93 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
95 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @TLInt)
96 store i32 %x, ptr %0, align 4
100 define void @storeLongLong(i64 noundef %x) {
101 ; SMALL64-O0-LABEL: storeLongLong:
102 ; SMALL64-O0: # %bb.0: # %entry
103 ; SMALL64-O0-NEXT: ld r4, L..C1(r2) # target-flags(ppc-tprel) @TLLongLong
104 ; SMALL64-O0-NEXT: add r4, r13, r4
105 ; SMALL64-O0-NEXT: std r3, 0(r4)
106 ; SMALL64-O0-NEXT: blr
108 ; LARGE64-O0-LABEL: storeLongLong:
109 ; LARGE64-O0: # %bb.0: # %entry
110 ; LARGE64-O0-NEXT: addis r4, L..C1@u(r2)
111 ; LARGE64-O0-NEXT: ld r4, L..C1@l(r4)
112 ; LARGE64-O0-NEXT: add r4, r13, r4
113 ; LARGE64-O0-NEXT: std r3, 0(r4)
114 ; LARGE64-O0-NEXT: blr
116 ; SMALL32-O0-LABEL: storeLongLong:
117 ; SMALL32-O0: # %bb.0: # %entry
118 ; SMALL32-O0-NEXT: mflr r0
119 ; SMALL32-O0-NEXT: stwu r1, -32(r1)
120 ; SMALL32-O0-NEXT: stw r0, 40(r1)
121 ; SMALL32-O0-NEXT: mr r5, r4
122 ; SMALL32-O0-NEXT: stw r3, 28(r1) # 4-byte Folded Spill
123 ; SMALL32-O0-NEXT: # kill: def $r4 killed $r5
124 ; SMALL32-O0-NEXT: lwz r6, L..C1(r2) # target-flags(ppc-tprel) @TLLongLong
125 ; SMALL32-O0-NEXT: bla .__get_tpointer[PR]
126 ; SMALL32-O0-NEXT: mr r4, r3
127 ; SMALL32-O0-NEXT: lwz r3, 28(r1) # 4-byte Folded Reload
128 ; SMALL32-O0-NEXT: add r4, r4, r6
129 ; SMALL32-O0-NEXT: stw r5, 4(r4)
130 ; SMALL32-O0-NEXT: stw r3, 0(r4)
131 ; SMALL32-O0-NEXT: addi r1, r1, 32
132 ; SMALL32-O0-NEXT: lwz r0, 8(r1)
133 ; SMALL32-O0-NEXT: mtlr r0
134 ; SMALL32-O0-NEXT: blr
136 ; LARGE32-O0-LABEL: storeLongLong:
137 ; LARGE32-O0: # %bb.0: # %entry
138 ; LARGE32-O0-NEXT: mflr r0
139 ; LARGE32-O0-NEXT: stwu r1, -32(r1)
140 ; LARGE32-O0-NEXT: stw r0, 40(r1)
141 ; LARGE32-O0-NEXT: mr r5, r4
142 ; LARGE32-O0-NEXT: stw r3, 28(r1) # 4-byte Folded Spill
143 ; LARGE32-O0-NEXT: # kill: def $r4 killed $r5
144 ; LARGE32-O0-NEXT: addis r3, L..C1@u(r2)
145 ; LARGE32-O0-NEXT: lwz r6, L..C1@l(r3)
146 ; LARGE32-O0-NEXT: bla .__get_tpointer[PR]
147 ; LARGE32-O0-NEXT: mr r4, r3
148 ; LARGE32-O0-NEXT: lwz r3, 28(r1) # 4-byte Folded Reload
149 ; LARGE32-O0-NEXT: add r4, r4, r6
150 ; LARGE32-O0-NEXT: stw r5, 4(r4)
151 ; LARGE32-O0-NEXT: stw r3, 0(r4)
152 ; LARGE32-O0-NEXT: addi r1, r1, 32
153 ; LARGE32-O0-NEXT: lwz r0, 8(r1)
154 ; LARGE32-O0-NEXT: mtlr r0
155 ; LARGE32-O0-NEXT: blr
157 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: storeLongLong:
158 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
159 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: la r4, TLLongLong[UL]@le(r13)
160 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: std r3, 0(r4)
161 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
163 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: storeLongLong:
164 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
165 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: la r4, TLLongLong[UL]@le(r13)
166 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: std r3, 0(r4)
167 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
169 %0 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @TLLongLong)
170 store i64 %x, ptr %0, align 8
174 define void @storeDouble(double noundef %x) {
175 ; SMALL64-O0-LABEL: storeDouble:
176 ; SMALL64-O0: # %bb.0: # %entry
177 ; SMALL64-O0-NEXT: ld r3, L..C2(r2) # target-flags(ppc-tprel) @TLDouble
178 ; SMALL64-O0-NEXT: add r3, r13, r3
179 ; SMALL64-O0-NEXT: stxsdx f1, 0, r3
180 ; SMALL64-O0-NEXT: blr
182 ; LARGE64-O0-LABEL: storeDouble:
183 ; LARGE64-O0: # %bb.0: # %entry
184 ; LARGE64-O0-NEXT: addis r3, L..C2@u(r2)
185 ; LARGE64-O0-NEXT: ld r3, L..C2@l(r3)
186 ; LARGE64-O0-NEXT: add r3, r13, r3
187 ; LARGE64-O0-NEXT: stxsdx f1, 0, r3
188 ; LARGE64-O0-NEXT: blr
190 ; SMALL32-O0-LABEL: storeDouble:
191 ; SMALL32-O0: # %bb.0: # %entry
192 ; SMALL32-O0-NEXT: mflr r0
193 ; SMALL32-O0-NEXT: stwu r1, -32(r1)
194 ; SMALL32-O0-NEXT: stw r0, 40(r1)
195 ; SMALL32-O0-NEXT: lwz r4, L..C2(r2) # target-flags(ppc-tprel) @TLDouble
196 ; SMALL32-O0-NEXT: bla .__get_tpointer[PR]
197 ; SMALL32-O0-NEXT: add r3, r3, r4
198 ; SMALL32-O0-NEXT: stfd f1, 0(r3)
199 ; SMALL32-O0-NEXT: addi r1, r1, 32
200 ; SMALL32-O0-NEXT: lwz r0, 8(r1)
201 ; SMALL32-O0-NEXT: mtlr r0
202 ; SMALL32-O0-NEXT: blr
204 ; LARGE32-O0-LABEL: storeDouble:
205 ; LARGE32-O0: # %bb.0: # %entry
206 ; LARGE32-O0-NEXT: mflr r0
207 ; LARGE32-O0-NEXT: stwu r1, -32(r1)
208 ; LARGE32-O0-NEXT: stw r0, 40(r1)
209 ; LARGE32-O0-NEXT: addis r3, L..C2@u(r2)
210 ; LARGE32-O0-NEXT: lwz r4, L..C2@l(r3)
211 ; LARGE32-O0-NEXT: bla .__get_tpointer[PR]
212 ; LARGE32-O0-NEXT: add r3, r3, r4
213 ; LARGE32-O0-NEXT: stfd f1, 0(r3)
214 ; LARGE32-O0-NEXT: addi r1, r1, 32
215 ; LARGE32-O0-NEXT: lwz r0, 8(r1)
216 ; LARGE32-O0-NEXT: mtlr r0
217 ; LARGE32-O0-NEXT: blr
219 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: storeDouble:
220 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
221 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: la r3, TLDouble[UL]@le(r13)
222 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: stxsdx f1, 0, r3
223 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
225 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: storeDouble:
226 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
227 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: la r3, TLDouble[UL]@le(r13)
228 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: stxsdx f1, 0, r3
229 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
231 %0 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @TLDouble)
232 store double %x, ptr %0, align 8
236 define void @storeFloat(float noundef %x) {
237 ; SMALL64-O0-LABEL: storeFloat:
238 ; SMALL64-O0: # %bb.0: # %entry
239 ; SMALL64-O0-NEXT: ld r3, L..C3(r2) # target-flags(ppc-tprel) @TLFloat
240 ; SMALL64-O0-NEXT: add r3, r13, r3
241 ; SMALL64-O0-NEXT: stfs f1, 0(r3)
242 ; SMALL64-O0-NEXT: blr
244 ; LARGE64-O0-LABEL: storeFloat:
245 ; LARGE64-O0: # %bb.0: # %entry
246 ; LARGE64-O0-NEXT: addis r3, L..C3@u(r2)
247 ; LARGE64-O0-NEXT: ld r3, L..C3@l(r3)
248 ; LARGE64-O0-NEXT: add r3, r13, r3
249 ; LARGE64-O0-NEXT: stfs f1, 0(r3)
250 ; LARGE64-O0-NEXT: blr
252 ; SMALL32-O0-LABEL: storeFloat:
253 ; SMALL32-O0: # %bb.0: # %entry
254 ; SMALL32-O0-NEXT: mflr r0
255 ; SMALL32-O0-NEXT: stwu r1, -32(r1)
256 ; SMALL32-O0-NEXT: stw r0, 40(r1)
257 ; SMALL32-O0-NEXT: lwz r4, L..C3(r2) # target-flags(ppc-tprel) @TLFloat
258 ; SMALL32-O0-NEXT: bla .__get_tpointer[PR]
259 ; SMALL32-O0-NEXT: add r3, r3, r4
260 ; SMALL32-O0-NEXT: stfs f1, 0(r3)
261 ; SMALL32-O0-NEXT: addi r1, r1, 32
262 ; SMALL32-O0-NEXT: lwz r0, 8(r1)
263 ; SMALL32-O0-NEXT: mtlr r0
264 ; SMALL32-O0-NEXT: blr
266 ; LARGE32-O0-LABEL: storeFloat:
267 ; LARGE32-O0: # %bb.0: # %entry
268 ; LARGE32-O0-NEXT: mflr r0
269 ; LARGE32-O0-NEXT: stwu r1, -32(r1)
270 ; LARGE32-O0-NEXT: stw r0, 40(r1)
271 ; LARGE32-O0-NEXT: addis r3, L..C3@u(r2)
272 ; LARGE32-O0-NEXT: lwz r4, L..C3@l(r3)
273 ; LARGE32-O0-NEXT: bla .__get_tpointer[PR]
274 ; LARGE32-O0-NEXT: add r3, r3, r4
275 ; LARGE32-O0-NEXT: stfs f1, 0(r3)
276 ; LARGE32-O0-NEXT: addi r1, r1, 32
277 ; LARGE32-O0-NEXT: lwz r0, 8(r1)
278 ; LARGE32-O0-NEXT: mtlr r0
279 ; LARGE32-O0-NEXT: blr
281 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: storeFloat:
282 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
283 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: la r3, TLFloat[UL]@le(r13)
284 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: stfs f1, 0(r3)
285 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
287 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: storeFloat:
288 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
289 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: la r3, TLFloat[UL]@le(r13)
290 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: stfs f1, 0(r3)
291 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
293 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @TLFloat)
294 store float %x, ptr %0, align 4
298 define i32 @loadInt() {
299 ; SMALL64-O0-LABEL: loadInt:
300 ; SMALL64-O0: # %bb.0: # %entry
301 ; SMALL64-O0-NEXT: ld r3, L..C0(r2) # target-flags(ppc-tprel) @TLInt
302 ; SMALL64-O0-NEXT: add r3, r13, r3
303 ; SMALL64-O0-NEXT: lwz r3, 0(r3)
304 ; SMALL64-O0-NEXT: blr
306 ; LARGE64-O0-LABEL: loadInt:
307 ; LARGE64-O0: # %bb.0: # %entry
308 ; LARGE64-O0-NEXT: addis r3, L..C0@u(r2)
309 ; LARGE64-O0-NEXT: ld r3, L..C0@l(r3)
310 ; LARGE64-O0-NEXT: add r3, r13, r3
311 ; LARGE64-O0-NEXT: lwz r3, 0(r3)
312 ; LARGE64-O0-NEXT: blr
314 ; SMALL32-O0-LABEL: loadInt:
315 ; SMALL32-O0: # %bb.0: # %entry
316 ; SMALL32-O0-NEXT: mflr r0
317 ; SMALL32-O0-NEXT: stwu r1, -32(r1)
318 ; SMALL32-O0-NEXT: stw r0, 40(r1)
319 ; SMALL32-O0-NEXT: lwz r4, L..C0(r2) # target-flags(ppc-tprel) @TLInt
320 ; SMALL32-O0-NEXT: bla .__get_tpointer[PR]
321 ; SMALL32-O0-NEXT: add r3, r3, r4
322 ; SMALL32-O0-NEXT: lwz r3, 0(r3)
323 ; SMALL32-O0-NEXT: addi r1, r1, 32
324 ; SMALL32-O0-NEXT: lwz r0, 8(r1)
325 ; SMALL32-O0-NEXT: mtlr r0
326 ; SMALL32-O0-NEXT: blr
328 ; LARGE32-O0-LABEL: loadInt:
329 ; LARGE32-O0: # %bb.0: # %entry
330 ; LARGE32-O0-NEXT: mflr r0
331 ; LARGE32-O0-NEXT: stwu r1, -32(r1)
332 ; LARGE32-O0-NEXT: stw r0, 40(r1)
333 ; LARGE32-O0-NEXT: addis r3, L..C0@u(r2)
334 ; LARGE32-O0-NEXT: lwz r4, L..C0@l(r3)
335 ; LARGE32-O0-NEXT: bla .__get_tpointer[PR]
336 ; LARGE32-O0-NEXT: add r3, r3, r4
337 ; LARGE32-O0-NEXT: lwz r3, 0(r3)
338 ; LARGE32-O0-NEXT: addi r1, r1, 32
339 ; LARGE32-O0-NEXT: lwz r0, 8(r1)
340 ; LARGE32-O0-NEXT: mtlr r0
341 ; LARGE32-O0-NEXT: blr
343 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: loadInt:
344 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
345 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: la r3, TLInt[UL]@le(r13)
346 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lwz r3, 0(r3)
347 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
349 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: loadInt:
350 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
351 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: la r3, TLInt[UL]@le(r13)
352 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lwz r3, 0(r3)
353 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
355 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @TLInt)
356 %1 = load i32, ptr %0, align 4
360 define i32 @loadLongLong() {
361 ; SMALL64-O0-LABEL: loadLongLong:
362 ; SMALL64-O0: # %bb.0: # %entry
363 ; SMALL64-O0-NEXT: ld r3, L..C1(r2) # target-flags(ppc-tprel) @TLLongLong
364 ; SMALL64-O0-NEXT: add r3, r13, r3
365 ; SMALL64-O0-NEXT: ld r3, 0(r3)
366 ; SMALL64-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
367 ; SMALL64-O0-NEXT: clrldi r3, r3, 32
368 ; SMALL64-O0-NEXT: blr
370 ; LARGE64-O0-LABEL: loadLongLong:
371 ; LARGE64-O0: # %bb.0: # %entry
372 ; LARGE64-O0-NEXT: addis r3, L..C1@u(r2)
373 ; LARGE64-O0-NEXT: ld r3, L..C1@l(r3)
374 ; LARGE64-O0-NEXT: add r3, r13, r3
375 ; LARGE64-O0-NEXT: ld r3, 0(r3)
376 ; LARGE64-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
377 ; LARGE64-O0-NEXT: clrldi r3, r3, 32
378 ; LARGE64-O0-NEXT: blr
380 ; SMALL32-O0-LABEL: loadLongLong:
381 ; SMALL32-O0: # %bb.0: # %entry
382 ; SMALL32-O0-NEXT: mflr r0
383 ; SMALL32-O0-NEXT: stwu r1, -32(r1)
384 ; SMALL32-O0-NEXT: stw r0, 40(r1)
385 ; SMALL32-O0-NEXT: lwz r4, L..C1(r2) # target-flags(ppc-tprel) @TLLongLong
386 ; SMALL32-O0-NEXT: bla .__get_tpointer[PR]
387 ; SMALL32-O0-NEXT: add r3, r3, r4
388 ; SMALL32-O0-NEXT: lwz r3, 4(r3)
389 ; SMALL32-O0-NEXT: addi r1, r1, 32
390 ; SMALL32-O0-NEXT: lwz r0, 8(r1)
391 ; SMALL32-O0-NEXT: mtlr r0
392 ; SMALL32-O0-NEXT: blr
394 ; LARGE32-O0-LABEL: loadLongLong:
395 ; LARGE32-O0: # %bb.0: # %entry
396 ; LARGE32-O0-NEXT: mflr r0
397 ; LARGE32-O0-NEXT: stwu r1, -32(r1)
398 ; LARGE32-O0-NEXT: stw r0, 40(r1)
399 ; LARGE32-O0-NEXT: addis r3, L..C1@u(r2)
400 ; LARGE32-O0-NEXT: lwz r4, L..C1@l(r3)
401 ; LARGE32-O0-NEXT: bla .__get_tpointer[PR]
402 ; LARGE32-O0-NEXT: add r3, r3, r4
403 ; LARGE32-O0-NEXT: lwz r3, 4(r3)
404 ; LARGE32-O0-NEXT: addi r1, r1, 32
405 ; LARGE32-O0-NEXT: lwz r0, 8(r1)
406 ; LARGE32-O0-NEXT: mtlr r0
407 ; LARGE32-O0-NEXT: blr
409 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: loadLongLong:
410 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
411 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: la r3, TLLongLong[UL]@le(r13)
412 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: ld r3, 0(r3)
413 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: # kill: def $r3 killed $r3 killed $x3
414 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: clrldi r3, r3, 32
415 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
417 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: loadLongLong:
418 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
419 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: la r3, TLLongLong[UL]@le(r13)
420 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: ld r3, 0(r3)
421 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: # kill: def $r3 killed $r3 killed $x3
422 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: clrldi r3, r3, 32
423 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
425 %0 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @TLLongLong)
426 %1 = load i64, ptr %0, align 8
427 %conv = trunc i64 %1 to i32
431 define i32 @loadDouble() {
432 ; SMALL64-O0-LABEL: loadDouble:
433 ; SMALL64-O0: # %bb.0: # %entry
434 ; SMALL64-O0-NEXT: ld r3, L..C2(r2) # target-flags(ppc-tprel) @TLDouble
435 ; SMALL64-O0-NEXT: add r3, r13, r3
436 ; SMALL64-O0-NEXT: lfd f0, 0(r3)
437 ; SMALL64-O0-NEXT: # kill: def $f1 killed $f0
438 ; SMALL64-O0-NEXT: xscvdpsxws f0, f0
439 ; SMALL64-O0-NEXT: addi r3, r1, -12
440 ; SMALL64-O0-NEXT: stfiwx f0, 0, r3
441 ; SMALL64-O0-NEXT: lwz r3, -12(r1)
442 ; SMALL64-O0-NEXT: clrldi r3, r3, 32
443 ; SMALL64-O0-NEXT: blr
445 ; LARGE64-O0-LABEL: loadDouble:
446 ; LARGE64-O0: # %bb.0: # %entry
447 ; LARGE64-O0-NEXT: addis r3, L..C2@u(r2)
448 ; LARGE64-O0-NEXT: ld r3, L..C2@l(r3)
449 ; LARGE64-O0-NEXT: add r3, r13, r3
450 ; LARGE64-O0-NEXT: lfd f0, 0(r3)
451 ; LARGE64-O0-NEXT: # kill: def $f1 killed $f0
452 ; LARGE64-O0-NEXT: xscvdpsxws f0, f0
453 ; LARGE64-O0-NEXT: addi r3, r1, -12
454 ; LARGE64-O0-NEXT: stfiwx f0, 0, r3
455 ; LARGE64-O0-NEXT: lwz r3, -12(r1)
456 ; LARGE64-O0-NEXT: clrldi r3, r3, 32
457 ; LARGE64-O0-NEXT: blr
459 ; SMALL32-O0-LABEL: loadDouble:
460 ; SMALL32-O0: # %bb.0: # %entry
461 ; SMALL32-O0-NEXT: mflr r0
462 ; SMALL32-O0-NEXT: stwu r1, -32(r1)
463 ; SMALL32-O0-NEXT: stw r0, 40(r1)
464 ; SMALL32-O0-NEXT: lwz r4, L..C2(r2) # target-flags(ppc-tprel) @TLDouble
465 ; SMALL32-O0-NEXT: bla .__get_tpointer[PR]
466 ; SMALL32-O0-NEXT: add r3, r3, r4
467 ; SMALL32-O0-NEXT: lfd f0, 0(r3)
468 ; SMALL32-O0-NEXT: xscvdpsxws f0, f0
469 ; SMALL32-O0-NEXT: addi r3, r1, 28
470 ; SMALL32-O0-NEXT: stfiwx f0, 0, r3
471 ; SMALL32-O0-NEXT: lwz r3, 28(r1)
472 ; SMALL32-O0-NEXT: addi r1, r1, 32
473 ; SMALL32-O0-NEXT: lwz r0, 8(r1)
474 ; SMALL32-O0-NEXT: mtlr r0
475 ; SMALL32-O0-NEXT: blr
477 ; LARGE32-O0-LABEL: loadDouble:
478 ; LARGE32-O0: # %bb.0: # %entry
479 ; LARGE32-O0-NEXT: mflr r0
480 ; LARGE32-O0-NEXT: stwu r1, -32(r1)
481 ; LARGE32-O0-NEXT: stw r0, 40(r1)
482 ; LARGE32-O0-NEXT: addis r3, L..C2@u(r2)
483 ; LARGE32-O0-NEXT: lwz r4, L..C2@l(r3)
484 ; LARGE32-O0-NEXT: bla .__get_tpointer[PR]
485 ; LARGE32-O0-NEXT: add r3, r3, r4
486 ; LARGE32-O0-NEXT: lfd f0, 0(r3)
487 ; LARGE32-O0-NEXT: xscvdpsxws f0, f0
488 ; LARGE32-O0-NEXT: addi r3, r1, 28
489 ; LARGE32-O0-NEXT: stfiwx f0, 0, r3
490 ; LARGE32-O0-NEXT: lwz r3, 28(r1)
491 ; LARGE32-O0-NEXT: addi r1, r1, 32
492 ; LARGE32-O0-NEXT: lwz r0, 8(r1)
493 ; LARGE32-O0-NEXT: mtlr r0
494 ; LARGE32-O0-NEXT: blr
496 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: loadDouble:
497 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
498 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: la r3, TLDouble[UL]@le(r13)
499 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lfd f0, 0(r3)
500 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: # kill: def $f1 killed $f0
501 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: xscvdpsxws f0, f0
502 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: addi r3, r1, -12
503 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: stfiwx f0, 0, r3
504 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lwz r3, -12(r1)
505 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: clrldi r3, r3, 32
506 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
508 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: loadDouble:
509 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
510 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: la r3, TLDouble[UL]@le(r13)
511 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lfd f0, 0(r3)
512 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: # kill: def $f1 killed $f0
513 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: xscvdpsxws f0, f0
514 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: addi r3, r1, -12
515 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: stfiwx f0, 0, r3
516 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lwz r3, -12(r1)
517 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: clrldi r3, r3, 32
518 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
520 %0 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @TLDouble)
521 %1 = load double, ptr %0, align 8
522 %conv = fptosi double %1 to i32
526 define i32 @loadFloat() {
527 ; SMALL64-O0-LABEL: loadFloat:
528 ; SMALL64-O0: # %bb.0: # %entry
529 ; SMALL64-O0-NEXT: ld r3, L..C3(r2) # target-flags(ppc-tprel) @TLFloat
530 ; SMALL64-O0-NEXT: add r3, r13, r3
531 ; SMALL64-O0-NEXT: lfs f0, 0(r3)
532 ; SMALL64-O0-NEXT: fctiwz f0, f0
533 ; SMALL64-O0-NEXT: stfd f0, -8(r1)
534 ; SMALL64-O0-NEXT: lwa r3, -4(r1)
535 ; SMALL64-O0-NEXT: clrldi r3, r3, 32
536 ; SMALL64-O0-NEXT: blr
538 ; LARGE64-O0-LABEL: loadFloat:
539 ; LARGE64-O0: # %bb.0: # %entry
540 ; LARGE64-O0-NEXT: addis r3, L..C3@u(r2)
541 ; LARGE64-O0-NEXT: ld r3, L..C3@l(r3)
542 ; LARGE64-O0-NEXT: add r3, r13, r3
543 ; LARGE64-O0-NEXT: lfs f0, 0(r3)
544 ; LARGE64-O0-NEXT: fctiwz f0, f0
545 ; LARGE64-O0-NEXT: stfd f0, -8(r1)
546 ; LARGE64-O0-NEXT: lwa r3, -4(r1)
547 ; LARGE64-O0-NEXT: clrldi r3, r3, 32
548 ; LARGE64-O0-NEXT: blr
550 ; SMALL32-O0-LABEL: loadFloat:
551 ; SMALL32-O0: # %bb.0: # %entry
552 ; SMALL32-O0-NEXT: mflr r0
553 ; SMALL32-O0-NEXT: stwu r1, -32(r1)
554 ; SMALL32-O0-NEXT: stw r0, 40(r1)
555 ; SMALL32-O0-NEXT: lwz r4, L..C3(r2) # target-flags(ppc-tprel) @TLFloat
556 ; SMALL32-O0-NEXT: bla .__get_tpointer[PR]
557 ; SMALL32-O0-NEXT: add r3, r3, r4
558 ; SMALL32-O0-NEXT: lfs f0, 0(r3)
559 ; SMALL32-O0-NEXT: xscvdpsxws f0, f0
560 ; SMALL32-O0-NEXT: addi r3, r1, 28
561 ; SMALL32-O0-NEXT: stfiwx f0, 0, r3
562 ; SMALL32-O0-NEXT: lwz r3, 28(r1)
563 ; SMALL32-O0-NEXT: addi r1, r1, 32
564 ; SMALL32-O0-NEXT: lwz r0, 8(r1)
565 ; SMALL32-O0-NEXT: mtlr r0
566 ; SMALL32-O0-NEXT: blr
568 ; LARGE32-O0-LABEL: loadFloat:
569 ; LARGE32-O0: # %bb.0: # %entry
570 ; LARGE32-O0-NEXT: mflr r0
571 ; LARGE32-O0-NEXT: stwu r1, -32(r1)
572 ; LARGE32-O0-NEXT: stw r0, 40(r1)
573 ; LARGE32-O0-NEXT: addis r3, L..C3@u(r2)
574 ; LARGE32-O0-NEXT: lwz r4, L..C3@l(r3)
575 ; LARGE32-O0-NEXT: bla .__get_tpointer[PR]
576 ; LARGE32-O0-NEXT: add r3, r3, r4
577 ; LARGE32-O0-NEXT: lfs f0, 0(r3)
578 ; LARGE32-O0-NEXT: xscvdpsxws f0, f0
579 ; LARGE32-O0-NEXT: addi r3, r1, 28
580 ; LARGE32-O0-NEXT: stfiwx f0, 0, r3
581 ; LARGE32-O0-NEXT: lwz r3, 28(r1)
582 ; LARGE32-O0-NEXT: addi r1, r1, 32
583 ; LARGE32-O0-NEXT: lwz r0, 8(r1)
584 ; LARGE32-O0-NEXT: mtlr r0
585 ; LARGE32-O0-NEXT: blr
587 ; SMALL-LOCAL-EXEC-SMALLCM64-LABEL: loadFloat:
588 ; SMALL-LOCAL-EXEC-SMALLCM64: # %bb.0: # %entry
589 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: la r3, TLFloat[UL]@le(r13)
590 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lfs f0, 0(r3)
591 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: fctiwz f0, f0
592 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: stfd f0, -8(r1)
593 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: lwa r3, -4(r1)
594 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: clrldi r3, r3, 32
595 ; SMALL-LOCAL-EXEC-SMALLCM64-NEXT: blr
597 ; SMALL-LOCAL-EXEC-LARGECM64-LABEL: loadFloat:
598 ; SMALL-LOCAL-EXEC-LARGECM64: # %bb.0: # %entry
599 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: la r3, TLFloat[UL]@le(r13)
600 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lfs f0, 0(r3)
601 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: fctiwz f0, f0
602 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: stfd f0, -8(r1)
603 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: lwa r3, -4(r1)
604 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: clrldi r3, r3, 32
605 ; SMALL-LOCAL-EXEC-LARGECM64-NEXT: blr
607 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @TLFloat)
608 %1 = load float, ptr %0, align 4
609 %conv = fptosi float %1 to i32
615 ; SMALL64-O0-LABEL: .toc
616 ; SMALL64-O0-LABEL:L..C0:
617 ; SMALL64-O0-NEXT: .tc TLInt[TC],TLInt[UL]@le
618 ; SMALL64-O0-LABEL:L..C1:
619 ; SMALL64-O0-NEXT: .tc TLLongLong[TC],TLLongLong[UL]@le
620 ; SMALL64-O0-LABEL:L..C2:
621 ; SMALL64-O0-NEXT: .tc TLDouble[TC],TLDouble[UL]@le
622 ; SMALL64-O0-LABEL:L..C3:
623 ; SMALL64-O0-NEXT: .tc TLFloat[TC],TLFloat[UL]@le
625 ; LARGE64-O0-LABEL: .toc
626 ; LARGE64-O0-LABEL:L..C0:
627 ; LARGE64-O0-NEXT: .tc TLInt[TE],TLInt[UL]@le
628 ; LARGE64-O0-LABEL:L..C1:
629 ; LARGE64-O0-NEXT: .tc TLLongLong[TE],TLLongLong[UL]@le
630 ; LARGE64-O0-LABEL:L..C2:
631 ; LARGE64-O0-NEXT: .tc TLDouble[TE],TLDouble[UL]@le
632 ; LARGE64-O0-LABEL:L..C3:
633 ; LARGE64-O0-NEXT: .tc TLFloat[TE],TLFloat[UL]@le
635 ; SMALL32-O0-LABEL: .toc
636 ; SMALL32-O0-LABEL:L..C0:
637 ; SMALL32-O0-NEXT: .tc TLInt[TC],TLInt[UL]@le
638 ; SMALL32-O0-LABEL:L..C1:
639 ; SMALL32-O0-NEXT: .tc TLLongLong[TC],TLLongLong[UL]@le
640 ; SMALL32-O0-LABEL:L..C2:
641 ; SMALL32-O0-NEXT: .tc TLDouble[TC],TLDouble[UL]@le
642 ; SMALL32-O0-LABEL:L..C3:
643 ; SMALL32-O0-NEXT: .tc TLFloat[TC],TLFloat[UL]@le
645 ; LARGE32-O0-LABEL: .toc
646 ; LARGE32-O0-LABEL:L..C0:
647 ; LARGE32-O0-NEXT: .tc TLInt[TE],TLInt[UL]@le
648 ; LARGE32-O0-LABEL:L..C1:
649 ; LARGE32-O0-NEXT: .tc TLLongLong[TE],TLLongLong[UL]@le
650 ; LARGE32-O0-LABEL:L..C2:
651 ; LARGE32-O0-NEXT: .tc TLDouble[TE],TLDouble[UL]@le
652 ; LARGE32-O0-LABEL:L..C3:
653 ; LARGE32-O0-NEXT: .tc TLFloat[TE],TLFloat[UL]@le