1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch32 -mattr=+d --relocation-model=pic < %s | FileCheck %s --check-prefix=LA32PIC
3 ; RUN: llc --mtriple=loongarch64 -mattr=+d --relocation-model=pic < %s | FileCheck %s --check-prefix=LA64PIC
4 ; RUN: llc --mtriple=loongarch64 -mattr=+d --code-model=large --relocation-model=pic < %s | FileCheck %s --check-prefix=LA64LARGEPIC
5 ; RUN: llc --mtriple=loongarch32 -mattr=+d < %s | FileCheck %s --check-prefix=LA32NOPIC
6 ; RUN: llc --mtriple=loongarch64 -mattr=+d < %s | FileCheck %s --check-prefix=LA64NOPIC
7 ; RUN: llc --mtriple=loongarch64 -mattr=+d --code-model=large < %s | FileCheck %s --check-prefix=LA64LARGENOPIC
8 ; RUN: llc --mtriple=loongarch32 -mattr=+d --relocation-model=pic --enable-tlsdesc < %s \
9 ; RUN: | FileCheck %s --check-prefix=LA32DESC
10 ; RUN: llc --mtriple=loongarch64 -mattr=+d --relocation-model=pic --enable-tlsdesc < %s \
11 ; RUN: | FileCheck %s --check-prefix=LA64DESC
12 ; RUN: llc --mtriple=loongarch64 -mattr=+d --relocation-model=pic --enable-tlsdesc \
13 ; RUN: --code-model=large < %s | FileCheck %s --check-prefix=DESC64
15 ;; Check that TLS symbols are lowered correctly based on the specified
16 ;; model. Make sure they're external to avoid them all being optimised to Local
17 ;; Exec for the executable.
19 @unspecified = external thread_local global i32
20 @ld = external thread_local(localdynamic) global i32
21 @ie = external thread_local(initialexec) global i32
22 @le = external thread_local(localexec) global i32
24 ;; No model specified (global dynamic)
26 define ptr @f1() nounwind {
28 ; LA32PIC: # %bb.0: # %entry
29 ; LA32PIC-NEXT: addi.w $sp, $sp, -16
30 ; LA32PIC-NEXT: st.w $ra, $sp, 12 # 4-byte Folded Spill
31 ; LA32PIC-NEXT: pcalau12i $a0, %gd_pc_hi20(unspecified)
32 ; LA32PIC-NEXT: addi.w $a0, $a0, %got_pc_lo12(unspecified)
33 ; LA32PIC-NEXT: bl %plt(__tls_get_addr)
34 ; LA32PIC-NEXT: ld.w $ra, $sp, 12 # 4-byte Folded Reload
35 ; LA32PIC-NEXT: addi.w $sp, $sp, 16
39 ; LA64PIC: # %bb.0: # %entry
40 ; LA64PIC-NEXT: addi.d $sp, $sp, -16
41 ; LA64PIC-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
42 ; LA64PIC-NEXT: pcalau12i $a0, %gd_pc_hi20(unspecified)
43 ; LA64PIC-NEXT: addi.d $a0, $a0, %got_pc_lo12(unspecified)
44 ; LA64PIC-NEXT: bl %plt(__tls_get_addr)
45 ; LA64PIC-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
46 ; LA64PIC-NEXT: addi.d $sp, $sp, 16
49 ; LA64LARGEPIC-LABEL: f1:
50 ; LA64LARGEPIC: # %bb.0: # %entry
51 ; LA64LARGEPIC-NEXT: addi.d $sp, $sp, -16
52 ; LA64LARGEPIC-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
53 ; LA64LARGEPIC-NEXT: pcalau12i $a0, %gd_pc_hi20(unspecified)
54 ; LA64LARGEPIC-NEXT: addi.d $t8, $zero, %got_pc_lo12(unspecified)
55 ; LA64LARGEPIC-NEXT: lu32i.d $t8, %got64_pc_lo20(unspecified)
56 ; LA64LARGEPIC-NEXT: lu52i.d $t8, $t8, %got64_pc_hi12(unspecified)
57 ; LA64LARGEPIC-NEXT: add.d $a0, $t8, $a0
58 ; LA64LARGEPIC-NEXT: pcalau12i $ra, %pc_hi20(__tls_get_addr)
59 ; LA64LARGEPIC-NEXT: addi.d $t8, $zero, %pc_lo12(__tls_get_addr)
60 ; LA64LARGEPIC-NEXT: lu32i.d $t8, %pc64_lo20(__tls_get_addr)
61 ; LA64LARGEPIC-NEXT: lu52i.d $t8, $t8, %pc64_hi12(__tls_get_addr)
62 ; LA64LARGEPIC-NEXT: add.d $ra, $t8, $ra
63 ; LA64LARGEPIC-NEXT: jirl $ra, $ra, 0
64 ; LA64LARGEPIC-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
65 ; LA64LARGEPIC-NEXT: addi.d $sp, $sp, 16
66 ; LA64LARGEPIC-NEXT: ret
68 ; LA32NOPIC-LABEL: f1:
69 ; LA32NOPIC: # %bb.0: # %entry
70 ; LA32NOPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(unspecified)
71 ; LA32NOPIC-NEXT: ld.w $a0, $a0, %ie_pc_lo12(unspecified)
72 ; LA32NOPIC-NEXT: add.w $a0, $a0, $tp
75 ; LA64NOPIC-LABEL: f1:
76 ; LA64NOPIC: # %bb.0: # %entry
77 ; LA64NOPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(unspecified)
78 ; LA64NOPIC-NEXT: ld.d $a0, $a0, %ie_pc_lo12(unspecified)
79 ; LA64NOPIC-NEXT: add.d $a0, $a0, $tp
82 ; LA64LARGENOPIC-LABEL: f1:
83 ; LA64LARGENOPIC: # %bb.0: # %entry
84 ; LA64LARGENOPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(unspecified)
85 ; LA64LARGENOPIC-NEXT: addi.d $t8, $zero, %ie_pc_lo12(unspecified)
86 ; LA64LARGENOPIC-NEXT: lu32i.d $t8, %ie64_pc_lo20(unspecified)
87 ; LA64LARGENOPIC-NEXT: lu52i.d $t8, $t8, %ie64_pc_hi12(unspecified)
88 ; LA64LARGENOPIC-NEXT: ldx.d $a0, $t8, $a0
89 ; LA64LARGENOPIC-NEXT: add.d $a0, $a0, $tp
90 ; LA64LARGENOPIC-NEXT: ret
93 ; LA32DESC: # %bb.0: # %entry
94 ; LA32DESC-NEXT: addi.w $sp, $sp, -16
95 ; LA32DESC-NEXT: st.w $ra, $sp, 12 # 4-byte Folded Spill
96 ; LA32DESC-NEXT: pcalau12i $a0, %desc_pc_hi20(unspecified)
97 ; LA32DESC-NEXT: addi.w $a0, $a0, %desc_pc_lo12(unspecified)
98 ; LA32DESC-NEXT: ld.w $ra, $a0, %desc_ld(unspecified)
99 ; LA32DESC-NEXT: jirl $ra, $ra, %desc_call(unspecified)
100 ; LA32DESC-NEXT: add.w $a0, $a0, $tp
101 ; LA32DESC-NEXT: ld.w $ra, $sp, 12 # 4-byte Folded Reload
102 ; LA32DESC-NEXT: addi.w $sp, $sp, 16
105 ; LA64DESC-LABEL: f1:
106 ; LA64DESC: # %bb.0: # %entry
107 ; LA64DESC-NEXT: addi.d $sp, $sp, -16
108 ; LA64DESC-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
109 ; LA64DESC-NEXT: pcalau12i $a0, %desc_pc_hi20(unspecified)
110 ; LA64DESC-NEXT: addi.d $a0, $a0, %desc_pc_lo12(unspecified)
111 ; LA64DESC-NEXT: ld.d $ra, $a0, %desc_ld(unspecified)
112 ; LA64DESC-NEXT: jirl $ra, $ra, %desc_call(unspecified)
113 ; LA64DESC-NEXT: add.d $a0, $a0, $tp
114 ; LA64DESC-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
115 ; LA64DESC-NEXT: addi.d $sp, $sp, 16
119 ; DESC64: # %bb.0: # %entry
120 ; DESC64-NEXT: addi.d $sp, $sp, -16
121 ; DESC64-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
122 ; DESC64-NEXT: pcalau12i $a0, %desc_pc_hi20(unspecified)
123 ; DESC64-NEXT: addi.d $t8, $zero, %desc_pc_lo12(unspecified)
124 ; DESC64-NEXT: lu32i.d $t8, %desc64_pc_lo20(unspecified)
125 ; DESC64-NEXT: lu52i.d $t8, $t8, %desc64_pc_hi12(unspecified)
126 ; DESC64-NEXT: add.d $a0, $t8, $a0
127 ; DESC64-NEXT: ld.d $ra, $a0, %desc_ld(unspecified)
128 ; DESC64-NEXT: jirl $ra, $ra, %desc_call(unspecified)
129 ; DESC64-NEXT: add.d $a1, $a0, $tp
130 ; DESC64-NEXT: move $a0, $a1
131 ; DESC64-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
132 ; DESC64-NEXT: addi.d $sp, $sp, 16
138 ;; localdynamic specified
140 define ptr @f2() nounwind {
142 ; LA32PIC: # %bb.0: # %entry
143 ; LA32PIC-NEXT: addi.w $sp, $sp, -16
144 ; LA32PIC-NEXT: st.w $ra, $sp, 12 # 4-byte Folded Spill
145 ; LA32PIC-NEXT: pcalau12i $a0, %ld_pc_hi20(ld)
146 ; LA32PIC-NEXT: addi.w $a0, $a0, %got_pc_lo12(ld)
147 ; LA32PIC-NEXT: bl %plt(__tls_get_addr)
148 ; LA32PIC-NEXT: ld.w $ra, $sp, 12 # 4-byte Folded Reload
149 ; LA32PIC-NEXT: addi.w $sp, $sp, 16
153 ; LA64PIC: # %bb.0: # %entry
154 ; LA64PIC-NEXT: addi.d $sp, $sp, -16
155 ; LA64PIC-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
156 ; LA64PIC-NEXT: pcalau12i $a0, %ld_pc_hi20(ld)
157 ; LA64PIC-NEXT: addi.d $a0, $a0, %got_pc_lo12(ld)
158 ; LA64PIC-NEXT: bl %plt(__tls_get_addr)
159 ; LA64PIC-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
160 ; LA64PIC-NEXT: addi.d $sp, $sp, 16
163 ; LA64LARGEPIC-LABEL: f2:
164 ; LA64LARGEPIC: # %bb.0: # %entry
165 ; LA64LARGEPIC-NEXT: addi.d $sp, $sp, -16
166 ; LA64LARGEPIC-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
167 ; LA64LARGEPIC-NEXT: pcalau12i $a0, %ld_pc_hi20(ld)
168 ; LA64LARGEPIC-NEXT: addi.d $t8, $zero, %got_pc_lo12(ld)
169 ; LA64LARGEPIC-NEXT: lu32i.d $t8, %got64_pc_lo20(ld)
170 ; LA64LARGEPIC-NEXT: lu52i.d $t8, $t8, %got64_pc_hi12(ld)
171 ; LA64LARGEPIC-NEXT: add.d $a0, $t8, $a0
172 ; LA64LARGEPIC-NEXT: pcalau12i $ra, %pc_hi20(__tls_get_addr)
173 ; LA64LARGEPIC-NEXT: addi.d $t8, $zero, %pc_lo12(__tls_get_addr)
174 ; LA64LARGEPIC-NEXT: lu32i.d $t8, %pc64_lo20(__tls_get_addr)
175 ; LA64LARGEPIC-NEXT: lu52i.d $t8, $t8, %pc64_hi12(__tls_get_addr)
176 ; LA64LARGEPIC-NEXT: add.d $ra, $t8, $ra
177 ; LA64LARGEPIC-NEXT: jirl $ra, $ra, 0
178 ; LA64LARGEPIC-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
179 ; LA64LARGEPIC-NEXT: addi.d $sp, $sp, 16
180 ; LA64LARGEPIC-NEXT: ret
182 ; LA32NOPIC-LABEL: f2:
183 ; LA32NOPIC: # %bb.0: # %entry
184 ; LA32NOPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(ld)
185 ; LA32NOPIC-NEXT: ld.w $a0, $a0, %ie_pc_lo12(ld)
186 ; LA32NOPIC-NEXT: add.w $a0, $a0, $tp
187 ; LA32NOPIC-NEXT: ret
189 ; LA64NOPIC-LABEL: f2:
190 ; LA64NOPIC: # %bb.0: # %entry
191 ; LA64NOPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(ld)
192 ; LA64NOPIC-NEXT: ld.d $a0, $a0, %ie_pc_lo12(ld)
193 ; LA64NOPIC-NEXT: add.d $a0, $a0, $tp
194 ; LA64NOPIC-NEXT: ret
196 ; LA64LARGENOPIC-LABEL: f2:
197 ; LA64LARGENOPIC: # %bb.0: # %entry
198 ; LA64LARGENOPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(ld)
199 ; LA64LARGENOPIC-NEXT: addi.d $t8, $zero, %ie_pc_lo12(ld)
200 ; LA64LARGENOPIC-NEXT: lu32i.d $t8, %ie64_pc_lo20(ld)
201 ; LA64LARGENOPIC-NEXT: lu52i.d $t8, $t8, %ie64_pc_hi12(ld)
202 ; LA64LARGENOPIC-NEXT: ldx.d $a0, $t8, $a0
203 ; LA64LARGENOPIC-NEXT: add.d $a0, $a0, $tp
204 ; LA64LARGENOPIC-NEXT: ret
206 ; LA32DESC-LABEL: f2:
207 ; LA32DESC: # %bb.0: # %entry
208 ; LA32DESC-NEXT: addi.w $sp, $sp, -16
209 ; LA32DESC-NEXT: st.w $ra, $sp, 12 # 4-byte Folded Spill
210 ; LA32DESC-NEXT: pcalau12i $a0, %desc_pc_hi20(ld)
211 ; LA32DESC-NEXT: addi.w $a0, $a0, %desc_pc_lo12(ld)
212 ; LA32DESC-NEXT: ld.w $ra, $a0, %desc_ld(ld)
213 ; LA32DESC-NEXT: jirl $ra, $ra, %desc_call(ld)
214 ; LA32DESC-NEXT: add.w $a0, $a0, $tp
215 ; LA32DESC-NEXT: ld.w $ra, $sp, 12 # 4-byte Folded Reload
216 ; LA32DESC-NEXT: addi.w $sp, $sp, 16
219 ; LA64DESC-LABEL: f2:
220 ; LA64DESC: # %bb.0: # %entry
221 ; LA64DESC-NEXT: addi.d $sp, $sp, -16
222 ; LA64DESC-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
223 ; LA64DESC-NEXT: pcalau12i $a0, %desc_pc_hi20(ld)
224 ; LA64DESC-NEXT: addi.d $a0, $a0, %desc_pc_lo12(ld)
225 ; LA64DESC-NEXT: ld.d $ra, $a0, %desc_ld(ld)
226 ; LA64DESC-NEXT: jirl $ra, $ra, %desc_call(ld)
227 ; LA64DESC-NEXT: add.d $a0, $a0, $tp
228 ; LA64DESC-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
229 ; LA64DESC-NEXT: addi.d $sp, $sp, 16
233 ; DESC64: # %bb.0: # %entry
234 ; DESC64-NEXT: addi.d $sp, $sp, -16
235 ; DESC64-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
236 ; DESC64-NEXT: pcalau12i $a0, %desc_pc_hi20(ld)
237 ; DESC64-NEXT: addi.d $t8, $zero, %desc_pc_lo12(ld)
238 ; DESC64-NEXT: lu32i.d $t8, %desc64_pc_lo20(ld)
239 ; DESC64-NEXT: lu52i.d $t8, $t8, %desc64_pc_hi12(ld)
240 ; DESC64-NEXT: add.d $a0, $t8, $a0
241 ; DESC64-NEXT: ld.d $ra, $a0, %desc_ld(ld)
242 ; DESC64-NEXT: jirl $ra, $ra, %desc_call(ld)
243 ; DESC64-NEXT: add.d $a1, $a0, $tp
244 ; DESC64-NEXT: move $a0, $a1
245 ; DESC64-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
246 ; DESC64-NEXT: addi.d $sp, $sp, 16
252 ;; initialexec specified
254 define ptr @f3() nounwind {
256 ; LA32PIC: # %bb.0: # %entry
257 ; LA32PIC-NEXT: pcalau12i $a0, %ie_pc_hi20(ie)
258 ; LA32PIC-NEXT: ld.w $a0, $a0, %ie_pc_lo12(ie)
259 ; LA32PIC-NEXT: add.w $a0, $a0, $tp
263 ; LA64PIC: # %bb.0: # %entry
264 ; LA64PIC-NEXT: pcalau12i $a0, %ie_pc_hi20(ie)
265 ; LA64PIC-NEXT: ld.d $a0, $a0, %ie_pc_lo12(ie)
266 ; LA64PIC-NEXT: add.d $a0, $a0, $tp
269 ; LA64LARGEPIC-LABEL: f3:
270 ; LA64LARGEPIC: # %bb.0: # %entry
271 ; LA64LARGEPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(ie)
272 ; LA64LARGEPIC-NEXT: addi.d $t8, $zero, %ie_pc_lo12(ie)
273 ; LA64LARGEPIC-NEXT: lu32i.d $t8, %ie64_pc_lo20(ie)
274 ; LA64LARGEPIC-NEXT: lu52i.d $t8, $t8, %ie64_pc_hi12(ie)
275 ; LA64LARGEPIC-NEXT: ldx.d $a0, $t8, $a0
276 ; LA64LARGEPIC-NEXT: add.d $a0, $a0, $tp
277 ; LA64LARGEPIC-NEXT: ret
279 ; LA32NOPIC-LABEL: f3:
280 ; LA32NOPIC: # %bb.0: # %entry
281 ; LA32NOPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(ie)
282 ; LA32NOPIC-NEXT: ld.w $a0, $a0, %ie_pc_lo12(ie)
283 ; LA32NOPIC-NEXT: add.w $a0, $a0, $tp
284 ; LA32NOPIC-NEXT: ret
286 ; LA64NOPIC-LABEL: f3:
287 ; LA64NOPIC: # %bb.0: # %entry
288 ; LA64NOPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(ie)
289 ; LA64NOPIC-NEXT: ld.d $a0, $a0, %ie_pc_lo12(ie)
290 ; LA64NOPIC-NEXT: add.d $a0, $a0, $tp
291 ; LA64NOPIC-NEXT: ret
293 ; LA64LARGENOPIC-LABEL: f3:
294 ; LA64LARGENOPIC: # %bb.0: # %entry
295 ; LA64LARGENOPIC-NEXT: pcalau12i $a0, %ie_pc_hi20(ie)
296 ; LA64LARGENOPIC-NEXT: addi.d $t8, $zero, %ie_pc_lo12(ie)
297 ; LA64LARGENOPIC-NEXT: lu32i.d $t8, %ie64_pc_lo20(ie)
298 ; LA64LARGENOPIC-NEXT: lu52i.d $t8, $t8, %ie64_pc_hi12(ie)
299 ; LA64LARGENOPIC-NEXT: ldx.d $a0, $t8, $a0
300 ; LA64LARGENOPIC-NEXT: add.d $a0, $a0, $tp
301 ; LA64LARGENOPIC-NEXT: ret
303 ; LA32DESC-LABEL: f3:
304 ; LA32DESC: # %bb.0: # %entry
305 ; LA32DESC-NEXT: pcalau12i $a0, %ie_pc_hi20(ie)
306 ; LA32DESC-NEXT: ld.w $a0, $a0, %ie_pc_lo12(ie)
307 ; LA32DESC-NEXT: add.w $a0, $a0, $tp
310 ; LA64DESC-LABEL: f3:
311 ; LA64DESC: # %bb.0: # %entry
312 ; LA64DESC-NEXT: pcalau12i $a0, %ie_pc_hi20(ie)
313 ; LA64DESC-NEXT: ld.d $a0, $a0, %ie_pc_lo12(ie)
314 ; LA64DESC-NEXT: add.d $a0, $a0, $tp
318 ; DESC64: # %bb.0: # %entry
319 ; DESC64-NEXT: pcalau12i $a0, %ie_pc_hi20(ie)
320 ; DESC64-NEXT: addi.d $t8, $zero, %ie_pc_lo12(ie)
321 ; DESC64-NEXT: lu32i.d $t8, %ie64_pc_lo20(ie)
322 ; DESC64-NEXT: lu52i.d $t8, $t8, %ie64_pc_hi12(ie)
323 ; DESC64-NEXT: ldx.d $a0, $t8, $a0
324 ; DESC64-NEXT: add.d $a0, $a0, $tp
330 ;; localexec specified
332 define ptr @f4() nounwind {
334 ; LA32PIC: # %bb.0: # %entry
335 ; LA32PIC-NEXT: lu12i.w $a0, %le_hi20(le)
336 ; LA32PIC-NEXT: ori $a0, $a0, %le_lo12(le)
337 ; LA32PIC-NEXT: add.w $a0, $a0, $tp
341 ; LA64PIC: # %bb.0: # %entry
342 ; LA64PIC-NEXT: lu12i.w $a0, %le_hi20(le)
343 ; LA64PIC-NEXT: ori $a0, $a0, %le_lo12(le)
344 ; LA64PIC-NEXT: add.d $a0, $a0, $tp
347 ; LA64LARGEPIC-LABEL: f4:
348 ; LA64LARGEPIC: # %bb.0: # %entry
349 ; LA64LARGEPIC-NEXT: lu12i.w $a0, %le_hi20(le)
350 ; LA64LARGEPIC-NEXT: ori $a0, $a0, %le_lo12(le)
351 ; LA64LARGEPIC-NEXT: lu32i.d $a0, %le64_lo20(le)
352 ; LA64LARGEPIC-NEXT: lu52i.d $a0, $a0, %le64_hi12(le)
353 ; LA64LARGEPIC-NEXT: add.d $a0, $a0, $tp
354 ; LA64LARGEPIC-NEXT: ret
356 ; LA32NOPIC-LABEL: f4:
357 ; LA32NOPIC: # %bb.0: # %entry
358 ; LA32NOPIC-NEXT: lu12i.w $a0, %le_hi20(le)
359 ; LA32NOPIC-NEXT: ori $a0, $a0, %le_lo12(le)
360 ; LA32NOPIC-NEXT: add.w $a0, $a0, $tp
361 ; LA32NOPIC-NEXT: ret
363 ; LA64NOPIC-LABEL: f4:
364 ; LA64NOPIC: # %bb.0: # %entry
365 ; LA64NOPIC-NEXT: lu12i.w $a0, %le_hi20(le)
366 ; LA64NOPIC-NEXT: ori $a0, $a0, %le_lo12(le)
367 ; LA64NOPIC-NEXT: add.d $a0, $a0, $tp
368 ; LA64NOPIC-NEXT: ret
370 ; LA64LARGENOPIC-LABEL: f4:
371 ; LA64LARGENOPIC: # %bb.0: # %entry
372 ; LA64LARGENOPIC-NEXT: lu12i.w $a0, %le_hi20(le)
373 ; LA64LARGENOPIC-NEXT: ori $a0, $a0, %le_lo12(le)
374 ; LA64LARGENOPIC-NEXT: lu32i.d $a0, %le64_lo20(le)
375 ; LA64LARGENOPIC-NEXT: lu52i.d $a0, $a0, %le64_hi12(le)
376 ; LA64LARGENOPIC-NEXT: add.d $a0, $a0, $tp
377 ; LA64LARGENOPIC-NEXT: ret
379 ; LA32DESC-LABEL: f4:
380 ; LA32DESC: # %bb.0: # %entry
381 ; LA32DESC-NEXT: lu12i.w $a0, %le_hi20(le)
382 ; LA32DESC-NEXT: ori $a0, $a0, %le_lo12(le)
383 ; LA32DESC-NEXT: add.w $a0, $a0, $tp
386 ; LA64DESC-LABEL: f4:
387 ; LA64DESC: # %bb.0: # %entry
388 ; LA64DESC-NEXT: lu12i.w $a0, %le_hi20(le)
389 ; LA64DESC-NEXT: ori $a0, $a0, %le_lo12(le)
390 ; LA64DESC-NEXT: add.d $a0, $a0, $tp
394 ; DESC64: # %bb.0: # %entry
395 ; DESC64-NEXT: lu12i.w $a0, %le_hi20(le)
396 ; DESC64-NEXT: ori $a0, $a0, %le_lo12(le)
397 ; DESC64-NEXT: lu32i.d $a0, %le64_lo20(le)
398 ; DESC64-NEXT: lu52i.d $a0, $a0, %le64_hi12(le)
399 ; DESC64-NEXT: add.d $a0, $a0, $tp