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 ("mov %%fs:0,%0\n\t" \
105 "lea " #x "@tpoff(%0), %0" \
111 asm ("mov %%fs:0,%0\n\t" \
112 "add " #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 # define TLS_GD_PREFIX
128 # define TLS_GD_PREFIX ".byte 0x66\n\t"
132 ({ int *__l, __c, __d; \
134 "leaq " #x "@tlsgd(%%rip),%%rdi\n\t" \
137 "call __tls_get_addr@plt" \
138 : "=a" (__l), "=&c" (__c), "=&d" (__d) \
139 : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \
145 ({ int *__l; void *__tp; \
146 asm ("stc gbr,%1\n\t" \
151 "1: .long " #x "@tpoff\n\t" \
153 : "=r" (__l), "=r" (__tp)); \
158 ({ int *__l; void *__tp; \
159 register void *__gp __asm__("r12"); \
160 asm ("mov.l 1f,r0\n\t" \
162 "mov.l @(r0,r12),%0\n\t" \
166 "1: .long " #x "@gottpoff\n\t" \
168 : "=r" (__l), "=r" (__tp) : "r" (__gp) : "r0"); \
172 ({ int *__l; void *__tp; \
173 asm ("mov.l r12,@-r15\n\t" \
179 "mov.l @(r0,r12),%0\n\t" \
183 "1: .long " #x "@gottpoff\n\t" \
184 "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
185 "2: mov.l @r15+,r12" \
186 : "=r" (__l), "=r" (__tp) : : "r0"); \
193 register void *__gp __asm__("r12"); \
194 asm ("mov.l 1f,r4\n\t" \
203 "1: .long " #x "@tlsldm\n\t" \
204 "2: .long __tls_get_addr@plt\n\t" \
205 "4: mov.l 3f,%0\n\t" \
209 "3: .long " #x "@dtpoff\n\t" \
211 : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
212 "r6", "r7", "pr", "t"); \
217 asm ("mov.l r12,@-r15\n\t" \
230 "1: .long " #x "@tlsldm\n\t" \
231 "2: .long __tls_get_addr@plt\n\t" \
232 "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
233 "4: mov.l 3f,%0\n\t" \
237 "3: .long " #x "@dtpoff\n\t" \
238 "5: mov.l @r15+,r12" \
239 : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
247 register void *__gp __asm__("r12"); \
248 asm ("mov.l 1f,r4\n\t" \
257 "1: .long " #x "@tlsgd\n\t" \
258 "2: .long __tls_get_addr@plt\n\t" \
260 : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
261 "r6", "r7", "pr", "t"); \
266 asm ("mov.l r12,@-r15\n\t" \
279 "1: .long " #x "@tlsgd\n\t" \
280 "2: .long __tls_get_addr@plt\n\t" \
281 "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
282 "3: mov.l @r15+,r12" \
283 : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
288 #elif defined __sparc__ && !defined __arch64__
292 asm ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
293 asm ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
294 asm ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
298 # define TLS_LOAD_PIC \
299 ({ register long pc __asm__ ("%o7"); \
301 asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
303 "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
304 "add %1, %0, %1\n\t" \
305 : "=r" (pc), "=r" (got)); \
308 # define TLS_LOAD_PIC \
310 asm (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
311 "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
312 "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
319 asm ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
320 asm ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
321 asm ("ld [%1 + %2], %0, %%tie_ld(" #x ")" \
322 : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
323 asm ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
327 ({ int *__l; register void *__o0 asm ("%o0"); \
329 asm ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
330 asm ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
331 asm ("add %1, %2, %0, %%tldm_add(" #x ")" \
332 : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
333 asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
335 : "=r" (__o0) : "0" (__o0) \
336 : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
338 asm ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
339 asm ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
340 asm ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
341 : "r" (__o0), "r" (__o)); \
345 ({ int *__l; register void *__o0 asm ("%o0"); \
346 asm ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
347 asm ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
348 asm ("add %1, %2, %0, %%tgd_add(" #x ")" \
349 : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
350 asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
352 : "=r" (__o0) : "0" (__o0) \
353 : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
357 #elif defined __sparc__ && defined __arch64__
361 asm ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
362 asm ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
363 asm ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
367 # define TLS_LOAD_PIC \
369 asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
371 "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
372 "add %1, %0, %1\n\t" \
373 : "=r" (pc), "=r" (got)); \
376 # define TLS_LOAD_PIC \
378 asm (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
379 "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
380 "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
387 asm ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
388 asm ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
389 asm ("ldx [%1 + %2], %0, %%tie_ldx(" #x ")" \
390 : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
391 asm ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
395 ({ int *__l; register void *__o0 asm ("%o0"); \
397 asm ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
398 asm ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
399 asm ("add %1, %2, %0, %%tldm_add(" #x ")" \
400 : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
401 asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
403 : "=r" (__o0) : "0" (__o0) \
404 : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
406 asm ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
407 asm ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
408 asm ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
409 : "r" (__o0), "r" (__o)); \
413 ({ int *__l; register void *__o0 asm ("%o0"); \
414 asm ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
415 asm ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
416 asm ("add %1, %2, %0, %%tgd_add(" #x ")" \
417 : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
418 asm ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
420 : "=r" (__o0) : "0" (__o0) \
421 : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
425 #elif defined __s390x__
428 ({ unsigned long __offset; \
429 asm ("bras %0,1f\n" \
430 "0:\t.quad " #x "@ntpoff\n" \
432 : "=a" (__offset) : : "cc" ); \
433 (int *) (__builtin_thread_pointer() + __offset); })
437 ({ unsigned long __offset; \
438 asm ("bras %0,1f\n" \
439 "0:\t.quad " #x "@gotntpoff\n" \
440 "1:\tlg %0,0(%0)\n\t" \
441 "lg %0,0(%0,%%r12):tls_load:" #x \
442 : "=&a" (__offset) : : "cc" ); \
443 (int *) (__builtin_thread_pointer() + __offset); })
446 ({ unsigned long __offset; \
447 asm ("bras %0,1f\n" \
448 "0:\t.quad " #x "@indntpoff\n" \
449 "1:\t lg %0,0(%0)\n\t" \
450 "lg %0,0(%0):tls_load:" #x \
451 : "=&a" (__offset) : : "cc" ); \
452 (int *) (__builtin_thread_pointer() + __offset); })
457 ({ unsigned long __offset, __save12; \
458 asm ("bras %0,1f\n" \
459 "0:\t.quad " #x "@tlsldm\n\t" \
460 ".quad " #x "@dtpoff\n" \
461 "1:\tlgr %1,%%r12\n\t" \
462 "larl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
463 "lg %%r2,0(%0)\n\t" \
464 "brasl %%r14,__tls_get_offset@plt:tls_ldcall:" #x "\n\t" \
468 : "=&a" (__offset), "=&a" (__save12) \
469 : : "cc", "0", "1", "2", "3", "4", "5", "14" ); \
470 (int *) (__builtin_thread_pointer() + __offset); })
473 ({ unsigned long __offset; \
474 asm ("bras %0,1f\n" \
475 "0:\t.quad " #x "@tlsldm\n\t" \
476 ".quad " #x "@dtpoff\n" \
477 "1:\tlarl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
478 "lg %%r2,0(%0)\n\t" \
479 "brasl %%r14,__tls_get_offset@plt:tls_ldcall:" #x "\n\t" \
483 : : "cc", "0", "1", "2", "3", "4", "5", "12", "14" ); \
484 (int *) (__builtin_thread_pointer() + __offset); })
489 ({ unsigned long __offset, __save12; \
490 asm ("bras %0,1f\n" \
491 "0:\t.quad " #x "@tlsgd\n" \
492 "1:\tlgr %1,%%r12\n\t" \
493 "larl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
494 "lg %%r2,0(%0)\n\t" \
495 "brasl %%r14,__tls_get_offset@plt:tls_gdcall:" #x "\n\t" \
498 : "=&a" (__offset), "=&a" (__save12) \
499 : : "cc", "0", "1", "2", "3", "4", "5", "14" ); \
500 (int *) (__builtin_thread_pointer() + __offset); })
503 ({ unsigned long __offset; \
504 asm ("bras %0,1f\n" \
505 "0:\t.quad " #x "@tlsgd\n" \
506 "1:\tlarl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
507 "lg %%r2,0(%0)\n\t" \
508 "brasl %%r14,__tls_get_offset@plt:tls_gdcall:" #x "\n\t" \
511 : : "cc", "0", "1", "2", "3", "4", "5", "12", "14" ); \
512 (int *) (__builtin_thread_pointer() + __offset); })
515 #elif defined __s390__
518 ({ unsigned long __offset; \
519 asm ("bras %0,1f\n" \
520 "0:\t.long " #x "@ntpoff\n" \
522 : "=a" (__offset) : : "cc" ); \
523 (int *) (__builtin_thread_pointer() + __offset); })
527 ({ unsigned long __offset; \
528 asm ("bras %0,1f\n" \
529 "0:\t.long " #x "@gotntpoff\n" \
530 "1:\tl %0,0(%0)\n\t" \
531 "l %0,0(%0,%%r12):tls_load:" #x \
532 : "=&a" (__offset) : : "cc" ); \
533 (int *) (__builtin_thread_pointer() + __offset); })
536 ({ unsigned long __offset; \
537 asm ("bras %0,1f\n" \
538 "0:\t.long " #x "@indntpoff\n" \
539 "1:\t l %0,0(%0)\n\t" \
540 "l %0,0(%0):tls_load:" #x \
541 : "=&a" (__offset) : : "cc" ); \
542 (int *) (__builtin_thread_pointer() + __offset); })
547 ({ unsigned long __offset, __save12; \
548 asm ("bras %0,1f\n" \
549 "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
550 ".long __tls_get_offset@plt-0b\n\t" \
551 ".long " #x "@tlsldm\n\t" \
552 ".long " #x "@dtpoff\n" \
553 "1:\tlr %1,%%r12\n\t" \
554 "l %%r12,0(%0)\n\t" \
555 "la %%r12,0(%%r12,%0)\n\t" \
558 "bas %%r14,0(%%r1,%0):tls_ldcall:" #x "\n\t" \
562 : "=&a" (__offset), "=&a" (__save12) \
563 : : "cc", "0", "1", "2", "3", "4", "5" ); \
564 (int *) (__builtin_thread_pointer() + __offset); })
567 ({ unsigned long __offset; \
568 asm ("bras %0,1f\n" \
569 "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
570 ".long __tls_get_offset@plt\n\t" \
571 ".long " #x "@tlsldm\n\t" \
572 ".long " #x "@dtpoff\n" \
573 "1:\tl %%r12,0(%0)\n\t" \
576 "bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \
579 : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
580 (int *) (__builtin_thread_pointer() + __offset); })
585 ({ unsigned long __offset, __save12; \
586 asm ("bras %0,1f\n" \
587 "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
588 ".long __tls_get_offset@plt-0b\n\t" \
589 ".long " #x "@tlsgd\n" \
590 "1:\tlr %1,%%r12\n\t" \
591 "l %%r12,0(%0)\n\t" \
592 "la %%r12,0(%%r12,%0)\n\t" \
595 "bas %%r14,0(%%r1,%0):tls_gdcall:" #x "\n\t" \
598 : "=&a" (__offset), "=&a" (__save12) \
599 : : "cc", "0", "1", "2", "3", "4", "5" ); \
600 (int *) (__builtin_thread_pointer() + __offset); })
603 ({ unsigned long __offset; \
604 asm ("bras %0,1f\n" \
605 "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
606 ".long __tls_get_offset@plt\n\t" \
607 ".long " #x "@tlsgd\n" \
608 "1:\tl %%r12,0(%0)\n\t" \
611 "bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \
613 : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
614 (int *) (__builtin_thread_pointer() + __offset); })
617 #elif defined __powerpc__
619 # define __TLS_CALL_CLOBBERS \
620 "0", "4", "5", "6", "7", "8", "9", "10", "11", "12", \
621 "lr", "ctr", "cr0", "cr1", "cr5", "cr6", "cr7"
623 # ifndef __powerpc64__
627 /* PowerPC32 Local Exec TLS access. */
630 asm ("addi %0,2," #x "@tprel" \
631 : "=r" (__result)); \
634 /* PowerPC32 Initial Exec TLS access. */
635 # ifdef HAVE_ASM_PPC_REL16
638 asm ("bcl 20,31,1f\n1:\t" \
640 "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
641 "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
642 "lwz %0," #x "@got@tprel(%0)\n\t" \
643 "add %0,%0," #x "@tls" \
644 : "=b" (__result) : \
650 asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
652 "lwz %0," #x "@got@tprel(%0)\n\t" \
653 "add %0,%0," #x "@tls" \
654 : "=b" (__result) : \
659 /* PowerPC32 Local Dynamic TLS access. */
660 # ifdef HAVE_ASM_PPC_REL16
663 asm ("bcl 20,31,1f\n1:\t" \
665 "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
666 "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
667 "addi 3,3," #x "@got@tlsld\n\t" \
668 "bl __tls_get_addr@plt\n\t" \
669 "addi %0,3," #x "@dtprel" \
670 : "=r" (__result) : \
671 : "3", __TLS_CALL_CLOBBERS); \
676 asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
678 "addi 3,3," #x "@got@tlsld\n\t" \
679 "bl __tls_get_addr@plt\n\t" \
680 "addi %0,3," #x "@dtprel" \
681 : "=r" (__result) : \
682 : "3", __TLS_CALL_CLOBBERS); \
686 /* PowerPC32 General Dynamic TLS access. */
687 # ifdef HAVE_ASM_PPC_REL16
689 ({ register int *__result __asm__ ("r3"); \
690 asm ("bcl 20,31,1f\n1:\t" \
692 "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
693 "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
694 "addi 3,3," #x "@got@tlsgd\n\t" \
695 "bl __tls_get_addr@plt" \
696 : "=r" (__result) : \
697 : __TLS_CALL_CLOBBERS); \
701 ({ register int *__result __asm__ ("r3"); \
702 asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
704 "addi 3,3," #x "@got@tlsgd\n\t" \
705 "bl __tls_get_addr@plt" \
706 : "=r" (__result) : \
707 : __TLS_CALL_CLOBBERS); \
713 /* PowerPC64 Local Exec TLS access. */
716 asm ("addis %0,13," #x "@tprel@ha\n\t" \
717 "addi %0,%0," #x "@tprel@l" \
718 : "=b" (__result) ); \
721 /* PowerPC64 Initial Exec TLS access. */
724 asm ("ld %0," #x "@got@tprel(2)\n\t" \
725 "add %0,%0," #x "@tls" \
726 : "=r" (__result) ); \
729 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
730 # define __TLS_GET_ADDR ".__tls_get_addr"
732 # define __TLS_GET_ADDR "__tls_get_addr"
734 /* PowerPC64 Local Dynamic TLS access. */
737 asm ("addi 3,2," #x "@got@tlsld\n\t" \
738 "bl " __TLS_GET_ADDR "\n\t" \
740 "addis %0,3," #x "@dtprel@ha\n\t" \
741 "addi %0,%0," #x "@dtprel@l" \
742 : "=b" (__result) : \
743 : "3", __TLS_CALL_CLOBBERS); \
746 /* PowerPC64 General Dynamic TLS access. */
748 ({ register int *__result __asm__ ("r3"); \
749 asm ("addi 3,2," #x "@got@tlsgd\n\t" \
750 "bl " __TLS_GET_ADDR "\n\t" \
752 : "=r" (__result) : \
753 : __TLS_CALL_CLOBBERS); \
758 #elif !defined TLS_LE || !defined TLS_IE \
759 || !defined TLS_LD || !defined TLS_GD
760 # error "No support for this architecture so far."