1 /* Macros to support TLS testing in times of missing compiler support. */
3 #if _MIPS_SIM != _ABI64
5 /* These versions are for o32 and n32. */
9 extern void *__tls_get_addr (void *); \
10 asm ("addiu %0, $28, %%tlsgd(" #x ")" \
12 (int *)__tls_get_addr (__result); })
16 extern void *__tls_get_addr (void *); \
17 asm ("daddiu %0, $28, %%tlsgd(" #x ")" \
19 (int *)__tls_get_addr (__result); })
22 #if _MIPS_SIM != _ABI64
25 extern void *__tls_get_addr (void *); \
26 asm ("addiu %0, $28, %%tlsldm(" #x ")" \
28 __result = __tls_get_addr (__result); \
29 asm ("lui $3,%%dtprel_hi(" #x ")\n\t" \
30 "addiu $3,$3,%%dtprel_lo(" #x ")\n\t" \
32 : "+r" (__result) : : "$3"); \
36 asm (".set push\n\t.set mips32r2\n\t" \
37 "rdhwr\t%0,$29\n\t.set pop" \
39 asm ("lw $3,%%gottprel(" #x ")($28)\n\t" \
41 : "+r" (__result) : : "$3"); \
45 asm (".set push\n\t.set mips32r2\n\t" \
46 "rdhwr\t%0,$29\n\t.set pop" \
48 asm ("lui $3,%%tprel_hi(" #x ")\n\t" \
49 "addiu $3,$3,%%tprel_lo(" #x ")\n\t" \
51 : "+r" (__result) : : "$3"); \
56 /* These versions are for n64. */
60 extern void *__tls_get_addr (void *); \
61 asm ("daddiu %0, $28, %%tlsldm(" #x ")" \
63 __result = __tls_get_addr (__result); \
64 asm ("lui $3,%%dtprel_hi(" #x ")\n\t" \
65 "daddiu $3,$3,%%dtprel_lo(" #x ")\n\t" \
67 : "+r" (__result) : : "$3"); \
71 asm (".set push\n\t.set mips32r2\n\t" \
72 "rdhwr\t%0,$29\n\t.set pop" \
74 asm ("ld $3,%%gottprel(" #x ")($28)\n\t" \
76 : "+r" (__result) : : "$3"); \
80 asm (".set push\n\t.set mips32r2\n\t" \
81 "rdhwr\t%0,$29\n\t.set pop" \
83 asm ("lui $3,%%tprel_hi(" #x ")\n\t" \
84 "daddiu $3,$3,%%tprel_lo(" #x ")\n\t" \
86 : "+r" (__result) : : "$3"); \