ARC: Fix max ULP for cosine test
[uclibc-ng.git] / test / tls / tls-macros-metag.h
blob5533ecd7618dcf18f238a57bd8755f97c44df0b6
1 #define TLS_GD(x) \
2 ({ void *__result; \
3 extern void *__tls_get_addr (void *); \
4 __asm__ ("MOV %0, A1LbP\n\t" \
5 "ADD %0, %0, #(" #x "@TLSGD)" \
6 : "=d" (__result)); \
7 (int *)__tls_get_addr (__result); })
9 #define TLS_LD(x) \
10 ({ void *__result; \
11 extern void *__tls_get_addr (void *); \
12 __asm__ ("MOV %0, A1LbP\n\t" \
13 "ADD %0, %0, #(" #x "@TLSLDM)" \
14 : "=d" (__result)); \
15 __result = __tls_get_addr (__result); \
16 __asm__ ("ADDT %0,%0,#HI(" #x "@TLSLDO)\n\t" \
17 "ADD %0,%0,#LO(" #x "@TLSLDO)" \
18 : "+d" (__result)); \
19 __result; })
21 #define TLS_IE(x) \
22 ({ void *__result; \
23 unsigned long __rel; \
24 extern void *__metag_load_tp (void); \
25 __asm__ ("GETD %0,[A1LbP+#(" #x "@TLSIE)]" \
26 : "=d" (__rel)); \
27 __result = __metag_load_tp(); \
28 __result + __rel; })
30 #define TLS_LE(x) \
31 ({ void *__result; \
32 extern void *__metag_load_tp (void); \
33 __result = __metag_load_tp(); \
34 __asm__ ("ADDT %0,%0,#HI(" #x "@TLSLE)\n\t" \
35 "ADD %0,%0,#LO(" #x "@TLSLE)" \
36 : "+d" (__result)); \
37 __result; })