1 /* Macros to support TLS testing in times of missing compiler support. */
3 #define COMMON_INT_DEF(x) \
4 asm (".tls_common " #x ",4,4")
5 /* XXX Until we get compiler support we don't need declarations. */
6 #define COMMON_INT_DECL(x)
8 /* XXX This definition will probably be machine specific, too. */
9 #define VAR_INT_DEF(x) \
10 asm (".section .tdata\n\t" \
14 ".size " #x ",4\n\t" \
16 /* XXX Until we get compiler support we don't need declarations. */
17 #define VAR_INT_DECL(x)
19 #include_next <tls-macros.h>
21 /* XXX Each architecture must have its own asm for now. */
25 asm ("movl %%gs:0,%0\n\t" \
26 "subl $" #x "@tpoff,%0" \
33 asm ("movl %%gs:0,%0\n\t" \
34 "subl " #x "@gottpoff(%%ebx),%0" \
42 "1:\tmovl (%%esp), %%ebx\n\t" \
45 "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
46 "movl %%gs:0,%0\n\t" \
47 "subl " #x "@gottpoff(%%ebx),%0" \
48 : "=r" (__l), "=&b" (__b)); \
54 ({ int *__l, __c, __d; \
55 asm ("leal " #x "@tlsldm(%%ebx),%%eax\n\t" \
56 "call ___tls_get_addr@plt\n\t" \
57 "leal " #x "@dtpoff(%%eax), %%eax" \
58 : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
62 ({ int *__l, __b, __c, __d; \
65 "1:\tmovl (%%esp), %%ebx\n\t" \
68 "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
69 "leal " #x "@tlsldm(%%ebx),%%eax\n\t" \
70 "call ___tls_get_addr@plt\n\t" \
71 "leal " #x "@dtpoff(%%eax), %%eax" \
72 : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \
78 ({ int *__l, __c, __d; \
79 asm ("leal " #x "@tlsgd(%%ebx),%%eax\n\t" \
80 "call ___tls_get_addr@plt\n\t" \
82 : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
86 ({ int *__l, __b, __c, __d; \
89 "1:\tmovl (%%esp), %%ebx\n\t" \
92 "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
93 "leal " #x "@tlsgd(%%ebx),%%eax\n\t" \
94 "call ___tls_get_addr@plt\n\t" \
96 : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \
100 #elif defined __x86_64__
104 asm ("movq %%fs:0,%0\n\t" \
105 "leaq " #x "@tpoff(%0), %0" \
111 asm ("movq %%fs:0,%0\n\t" \
112 "addq " #x "@gottpoff(%%rip),%0" \
117 ({ int *__l, __c, __d; \
118 asm ("leaq " #x "@tlsld(%%rip),%%rdi\n\t" \
119 "call __tls_get_addr@plt\n\t" \
120 "leaq " #x "@dtpoff(%%rax), %%rax" \
121 : "=a" (__l), "=&c" (__c), "=&d" (__d) \
122 : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \
126 ({ int *__l, __c, __d; \
127 asm (".byte 0x66\n\t" \
128 "leaq " #x "@tlsgd(%%rip),%%rdi\n\t" \
131 "call __tls_get_addr@plt" \
132 : "=a" (__l), "=&c" (__c), "=&d" (__d) \
133 : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \
139 ({ int *__l; void *__tp; \
140 asm ("stc gbr,%1\n\t" \
145 "1: .long " #x "@tpoff\n\t" \
147 : "=r" (__l), "=r" (__tp)); \
152 ({ int *__l; void *__tp; \
153 register void *__gp __asm__("r12"); \
154 asm ("mov.l 1f,r0\n\t" \
156 "mov.l @(r0,r12),%0\n\t" \
160 "1: .long " #x "@gottpoff\n\t" \
162 : "=r" (__l), "=r" (__tp) : "r" (__gp) : "r0"); \
166 ({ int *__l; void *__tp; \
167 asm ("mov.l r12,@-r15\n\t" \
173 "mov.l @(r0,r12),%0\n\t" \
177 "1: .long " #x "@gottpoff\n\t" \
178 "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
179 "2: mov.l @r15+,r12" \
180 : "=r" (__l), "=r" (__tp) : : "r0"); \
187 register void *__gp __asm__("r12"); \
188 asm ("mov.l 1f,r4\n\t" \
197 "1: .long " #x "@tlsldm\n\t" \
198 "2: .long __tls_get_addr@plt\n\t" \
199 "4: mov.l 3f,%0\n\t" \
203 "3: .long " #x "@dtpoff\n\t" \
205 : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
206 "r6", "r7", "pr", "t"); \
211 asm ("mov.l r12,@-r15\n\t" \
224 "1: .long " #x "@tlsldm\n\t" \
225 "2: .long __tls_get_addr@plt\n\t" \
226 "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
227 "4: mov.l 3f,%0\n\t" \
231 "3: .long " #x "@dtpoff\n\t" \
232 "5: mov.l @r15+,r12" \
233 : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
241 register void *__gp __asm__("r12"); \
242 asm ("mov.l 1f,r4\n\t" \
251 "1: .long " #x "@tlsgd\n\t" \
252 "2: .long __tls_get_addr@plt\n\t" \
254 : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
255 "r6", "r7", "pr", "t"); \
260 asm ("mov.l r12,@-r15\n\t" \
273 "1: .long " #x "@tlsgd\n\t" \
274 "2: .long __tls_get_addr@plt\n\t" \
275 "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
276 "3: mov.l @r15+,r12" \
277 : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
282 #elif defined __sparc__ && !defined __arch64__
286 asm ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
287 asm ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
288 asm ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
292 # define TLS_LOAD_PIC \
293 ({ register long pc __asm__ ("%o7"); \
295 asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
297 "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
298 "add %1, %0, %1\n\t" \
299 : "=r" (pc), "=r" (got)); \
302 # define TLS_LOAD_PIC \
304 asm (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
305 "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
306 "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
313 asm ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
314 asm ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
315 asm ("ld [%1 + %2], %0, %%tie_ld(" #x ")" \
316 : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
317 asm ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
321 ({ int *__l; register void *__o0 asm ("%o0"); \
323 asm ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
324 asm ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
325 asm ("add %1, %2, %0, %%tldm_add(" #x ")" \
326 : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
327 asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
329 : "=r" (__o0) : "0" (__o0) \
330 : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
332 asm ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
333 asm ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
334 asm ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
335 : "r" (__o0), "r" (__o)); \
339 ({ int *__l; register void *__o0 asm ("%o0"); \
340 asm ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
341 asm ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
342 asm ("add %1, %2, %0, %%tgd_add(" #x ")" \
343 : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
344 asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
346 : "=r" (__o0) : "0" (__o0) \
347 : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
351 #elif defined __sparc__ && defined __arch64__
355 asm ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
356 asm ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
357 asm ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
361 # define TLS_LOAD_PIC \
363 asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
365 "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
366 "add %1, %0, %1\n\t" \
367 : "=r" (pc), "=r" (got)); \
370 # define TLS_LOAD_PIC \
372 asm (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
373 "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
374 "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
381 asm ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
382 asm ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
383 asm ("ldx [%1 + %2], %0, %%tie_ldx(" #x ")" \
384 : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
385 asm ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
389 ({ int *__l; register void *__o0 asm ("%o0"); \
391 asm ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
392 asm ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
393 asm ("add %1, %2, %0, %%tldm_add(" #x ")" \
394 : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
395 asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
397 : "=r" (__o0) : "0" (__o0) \
398 : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
400 asm ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
401 asm ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
402 asm ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
403 : "r" (__o0), "r" (__o)); \
407 ({ int *__l; register void *__o0 asm ("%o0"); \
408 asm ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
409 asm ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
410 asm ("add %1, %2, %0, %%tgd_add(" #x ")" \
411 : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
412 asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
414 : "=r" (__o0) : "0" (__o0) \
415 : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
419 #elif defined __s390x__
422 ({ unsigned long __offset; \
423 asm ("bras %0,1f\n" \
424 "0:\t.quad " #x "@ntpoff\n" \
426 : "=a" (__offset) : : "cc" ); \
427 (int *) (__builtin_thread_pointer() + __offset); })
431 ({ unsigned long __offset; \
432 asm ("bras %0,1f\n" \
433 "0:\t.quad " #x "@gotntpoff\n" \
434 "1:\tlg %0,0(%0)\n\t" \
435 "lg %0,0(%0,%%r12):tls_load:" #x \
436 : "=&a" (__offset) : : "cc" ); \
437 (int *) (__builtin_thread_pointer() + __offset); })
440 ({ unsigned long __offset; \
441 asm ("bras %0,1f\n" \
442 "0:\t.quad " #x "@indntpoff\n" \
443 "1:\t lg %0,0(%0)\n\t" \
444 "lg %0,0(%0):tls_load:" #x \
445 : "=&a" (__offset) : : "cc" ); \
446 (int *) (__builtin_thread_pointer() + __offset); })
451 ({ unsigned long __offset, __save12; \
452 asm ("bras %0,1f\n" \
453 "0:\t.quad " #x "@tlsldm\n\t" \
454 ".quad " #x "@dtpoff\n" \
455 "1:\tlgr %1,%%r12\n\t" \
456 "larl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
457 "lg %%r2,0(%0)\n\t" \
458 "brasl %%r14,__tls_get_offset@plt:tls_ldcall:" #x "\n\t" \
462 : "=&a" (__offset), "=&a" (__save12) \
463 : : "cc", "0", "1", "2", "3", "4", "5", "14" ); \
464 (int *) (__builtin_thread_pointer() + __offset); })
467 ({ unsigned long __offset; \
468 asm ("bras %0,1f\n" \
469 "0:\t.quad " #x "@tlsldm\n\t" \
470 ".quad " #x "@dtpoff\n" \
471 "1:\tlarl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
472 "lg %%r2,0(%0)\n\t" \
473 "brasl %%r14,__tls_get_offset@plt:tls_ldcall:" #x "\n\t" \
477 : : "cc", "0", "1", "2", "3", "4", "5", "12", "14" ); \
478 (int *) (__builtin_thread_pointer() + __offset); })
483 ({ unsigned long __offset, __save12; \
484 asm ("bras %0,1f\n" \
485 "0:\t.quad " #x "@tlsgd\n" \
486 "1:\tlgr %1,%%r12\n\t" \
487 "larl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
488 "lg %%r2,0(%0)\n\t" \
489 "brasl %%r14,__tls_get_offset@plt:tls_gdcall:" #x "\n\t" \
492 : "=&a" (__offset), "=&a" (__save12) \
493 : : "cc", "0", "1", "2", "3", "4", "5", "14" ); \
494 (int *) (__builtin_thread_pointer() + __offset); })
497 ({ unsigned long __offset; \
498 asm ("bras %0,1f\n" \
499 "0:\t.quad " #x "@tlsgd\n" \
500 "1:\tlarl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
501 "lg %%r2,0(%0)\n\t" \
502 "brasl %%r14,__tls_get_offset@plt:tls_gdcall:" #x "\n\t" \
505 : : "cc", "0", "1", "2", "3", "4", "5", "12", "14" ); \
506 (int *) (__builtin_thread_pointer() + __offset); })
509 #elif defined __s390__
512 ({ unsigned long __offset; \
513 asm ("bras %0,1f\n" \
514 "0:\t.long " #x "@ntpoff\n" \
516 : "=a" (__offset) : : "cc" ); \
517 (int *) (__builtin_thread_pointer() + __offset); })
521 ({ unsigned long __offset; \
522 asm ("bras %0,1f\n" \
523 "0:\t.long " #x "@gotntpoff\n" \
524 "1:\tl %0,0(%0)\n\t" \
525 "l %0,0(%0,%%r12):tls_load:" #x \
526 : "=&a" (__offset) : : "cc" ); \
527 (int *) (__builtin_thread_pointer() + __offset); })
530 ({ unsigned long __offset; \
531 asm ("bras %0,1f\n" \
532 "0:\t.long " #x "@indntpoff\n" \
533 "1:\t l %0,0(%0)\n\t" \
534 "l %0,0(%0):tls_load:" #x \
535 : "=&a" (__offset) : : "cc" ); \
536 (int *) (__builtin_thread_pointer() + __offset); })
541 ({ unsigned long __offset, __save12; \
542 asm ("bras %0,1f\n" \
543 "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
544 ".long __tls_get_offset@plt-0b\n\t" \
545 ".long " #x "@tlsldm\n\t" \
546 ".long " #x "@dtpoff\n" \
547 "1:\tlr %1,%%r12\n\t" \
548 "l %%r12,0(%0)\n\t" \
549 "la %%r12,0(%%r12,%0)\n\t" \
552 "bas %%r14,0(%%r1,%0):tls_ldcall:" #x "\n\t" \
556 : "=&a" (__offset), "=&a" (__save12) \
557 : : "cc", "0", "1", "2", "3", "4", "5" ); \
558 (int *) (__builtin_thread_pointer() + __offset); })
561 ({ unsigned long __offset; \
562 asm ("bras %0,1f\n" \
563 "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
564 ".long __tls_get_offset@plt\n\t" \
565 ".long " #x "@tlsldm\n\t" \
566 ".long " #x "@dtpoff\n" \
567 "1:\tl %%r12,0(%0)\n\t" \
570 "bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \
573 : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
574 (int *) (__builtin_thread_pointer() + __offset); })
579 ({ unsigned long __offset, __save12; \
580 asm ("bras %0,1f\n" \
581 "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
582 ".long __tls_get_offset@plt-0b\n\t" \
583 ".long " #x "@tlsgd\n" \
584 "1:\tlr %1,%%r12\n\t" \
585 "l %%r12,0(%0)\n\t" \
586 "la %%r12,0(%%r12,%0)\n\t" \
589 "bas %%r14,0(%%r1,%0):tls_gdcall:" #x "\n\t" \
592 : "=&a" (__offset), "=&a" (__save12) \
593 : : "cc", "0", "1", "2", "3", "4", "5" ); \
594 (int *) (__builtin_thread_pointer() + __offset); })
597 ({ unsigned long __offset; \
598 asm ("bras %0,1f\n" \
599 "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
600 ".long __tls_get_offset@plt\n\t" \
601 ".long " #x "@tlsgd\n" \
602 "1:\tl %%r12,0(%0)\n\t" \
605 "bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \
607 : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
608 (int *) (__builtin_thread_pointer() + __offset); })
611 #elif defined __powerpc__
613 # define __TLS_CALL_CLOBBERS \
614 "0", "4", "5", "6", "7", "8", "9", "10", "11", "12", \
615 "lr", "ctr", "cr0", "cr1", "cr5", "cr6", "cr7"
617 # ifndef __powerpc64__
621 /* PowerPC32 Local Exec TLS access. */
624 asm ("addi %0,2," #x "@tprel" \
625 : "=r" (__result)); \
628 /* PowerPC32 Initial Exec TLS access. */
629 # ifdef HAVE_ASM_PPC_REL16
632 asm ("bcl 20,31,1f\n1:\t" \
634 "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
635 "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
636 "lwz %0," #x "@got@tprel(%0)\n\t" \
637 "add %0,%0," #x "@tls" \
638 : "=b" (__result) : \
644 asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
646 "lwz %0," #x "@got@tprel(%0)\n\t" \
647 "add %0,%0," #x "@tls" \
648 : "=b" (__result) : \
653 /* PowerPC32 Local Dynamic TLS access. */
654 # ifdef HAVE_ASM_PPC_REL16
657 asm ("bcl 20,31,1f\n1:\t" \
659 "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
660 "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
661 "addi 3,3," #x "@got@tlsld\n\t" \
662 "bl __tls_get_addr@plt\n\t" \
663 "addi %0,3," #x "@dtprel" \
664 : "=r" (__result) : \
665 : "3", __TLS_CALL_CLOBBERS); \
670 asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
672 "addi 3,3," #x "@got@tlsld\n\t" \
673 "bl __tls_get_addr@plt\n\t" \
674 "addi %0,3," #x "@dtprel" \
675 : "=r" (__result) : \
676 : "3", __TLS_CALL_CLOBBERS); \
680 /* PowerPC32 General Dynamic TLS access. */
681 # ifdef HAVE_ASM_PPC_REL16
683 ({ register int *__result __asm__ ("r3"); \
684 asm ("bcl 20,31,1f\n1:\t" \
686 "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
687 "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
688 "addi 3,3," #x "@got@tlsgd\n\t" \
689 "bl __tls_get_addr@plt" \
690 : "=r" (__result) : \
691 : __TLS_CALL_CLOBBERS); \
695 ({ register int *__result __asm__ ("r3"); \
696 asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
698 "addi 3,3," #x "@got@tlsgd\n\t" \
699 "bl __tls_get_addr@plt" \
700 : "=r" (__result) : \
701 : __TLS_CALL_CLOBBERS); \
707 /* PowerPC64 Local Exec TLS access. */
710 asm ("addis %0,13," #x "@tprel@ha\n\t" \
711 "addi %0,%0," #x "@tprel@l" \
712 : "=b" (__result) ); \
715 /* PowerPC64 Initial Exec TLS access. */
718 asm ("ld %0," #x "@got@tprel(2)\n\t" \
719 "add %0,%0," #x "@tls" \
720 : "=r" (__result) ); \
723 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
724 # define __TLS_GET_ADDR ".__tls_get_addr"
726 # define __TLS_GET_ADDR "__tls_get_addr"
728 /* PowerPC64 Local Dynamic TLS access. */
731 asm ("addi 3,2," #x "@got@tlsld\n\t" \
732 "bl " __TLS_GET_ADDR "\n\t" \
734 "addis %0,3," #x "@dtprel@ha\n\t" \
735 "addi %0,%0," #x "@dtprel@l" \
736 : "=b" (__result) : \
737 : "3", __TLS_CALL_CLOBBERS); \
740 /* PowerPC64 General Dynamic TLS access. */
742 ({ register int *__result __asm__ ("r3"); \
743 asm ("addi 3,2," #x "@got@tlsgd\n\t" \
744 "bl " __TLS_GET_ADDR "\n\t" \
746 : "=r" (__result) : \
747 : __TLS_CALL_CLOBBERS); \
752 #elif !defined TLS_LE || !defined TLS_IE \
753 || !defined TLS_LD || !defined TLS_GD
754 # error "No support for this architecture so far."