bg_BG locale: Fix a typo in a comment
[glibc.git] / sysdeps / tile / tls-macros.h
blob162d30925453492c67301b418f08cbd776879d7a
1 /* Copyright (C) 2011-2018 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
19 #define TLS_GD_OFFSET(x) \
20 "moveli r0, hw1_last_tls_gd(" #x ")\n\t" \
21 "shl16insli r0, r0, hw0_tls_gd(" #x ")\n\t" \
22 "addi r0, %1, tls_add(" #x ")\n\t"
24 #define TLS_GD(x) \
25 ({ \
26 int *__retval; \
27 extern char _GLOBAL_OFFSET_TABLE_[]; \
29 asm (TLS_GD_OFFSET(x) \
30 "jal tls_gd_call(" #x ")\n\t" \
31 "addi %0, r0, tls_gd_add(" #x ")" : \
32 "=&r" (__retval) : "r" (_GLOBAL_OFFSET_TABLE_) : \
33 "r0", "r25", "r26", "r27", "r28", "r29"); \
34 __retval; })
36 /* No special support for LD mode. */
37 #define TLS_LD TLS_GD
39 #define TLS_IE_OFFSET(x) \
40 "moveli %0, hw1_last_tls_ie(" #x ")\n\t" \
41 "shl16insli %0, %0, hw0_tls_ie(" #x ")\n\t" \
42 "addi %0, %1, tls_add(" #x ")\n\t"
43 #define LD_TLS "ld_tls"
45 #define TLS_IE(x) \
46 ({ \
47 int *__retval; \
48 extern char _GLOBAL_OFFSET_TABLE_[]; \
50 asm (TLS_IE_OFFSET(x) \
51 LD_TLS " %0, %0, tls_ie_load(" #x ")\n\t" \
52 "add %0, %0, tp" : \
53 "=&r" (__retval) : "r" (_GLOBAL_OFFSET_TABLE_)); \
54 __retval; })
56 #define _TLS_LE(x) \
57 "moveli %0, hw1_last_tls_le(" #x ")\n\t" \
58 "shl16insli %0, %0, hw0_tls_le(" #x ")\n\t" \
59 "add %0, %0, tp"
61 #define TLS_LE(x) \
62 ({ \
63 int *__retval; \
64 asm (_TLS_LE(x) : "=r" (__retval)); \
65 __retval; })