PAPI 7.1.0.0
Loading...
Searching...
No Matches
aarch64.h File Reference
Include dependency graph for aarch64.h:

Go to the source code of this file.

Macros

#define AO_HAVE_nop_write
 
#define AO_HAVE_double_load
 
#define AO_HAVE_double_load_acquire
 
#define AO_HAVE_double_store
 
#define AO_HAVE_double_store_release
 
#define AO_HAVE_double_compare_and_swap
 
#define AO_HAVE_double_compare_and_swap_acquire
 
#define AO_HAVE_double_compare_and_swap_release
 
#define AO_HAVE_double_compare_and_swap_full
 
#define AO_GCC_HAVE_double_SYNC_CAS
 

Functions

AO_INLINE void AO_nop_write (void)
 
AO_INLINE AO_double_t AO_double_load (const volatile AO_double_t *addr)
 
AO_INLINE AO_double_t AO_double_load_acquire (const volatile AO_double_t *addr)
 
AO_INLINE void AO_double_store (volatile AO_double_t *addr, AO_double_t value)
 
AO_INLINE void AO_double_store_release (volatile AO_double_t *addr, AO_double_t value)
 
AO_INLINE int AO_double_compare_and_swap (volatile AO_double_t *addr, AO_double_t old_val, AO_double_t new_val)
 
AO_INLINE int AO_double_compare_and_swap_acquire (volatile AO_double_t *addr, AO_double_t old_val, AO_double_t new_val)
 
AO_INLINE int AO_double_compare_and_swap_release (volatile AO_double_t *addr, AO_double_t old_val, AO_double_t new_val)
 
AO_INLINE int AO_double_compare_and_swap_full (volatile AO_double_t *addr, AO_double_t old_val, AO_double_t new_val)
 

Macro Definition Documentation

◆ AO_GCC_HAVE_double_SYNC_CAS

#define AO_GCC_HAVE_double_SYNC_CAS

Definition at line 269 of file aarch64.h.

◆ AO_HAVE_double_compare_and_swap

#define AO_HAVE_double_compare_and_swap

Definition at line 169 of file aarch64.h.

◆ AO_HAVE_double_compare_and_swap_acquire

#define AO_HAVE_double_compare_and_swap_acquire

Definition at line 200 of file aarch64.h.

◆ AO_HAVE_double_compare_and_swap_full

#define AO_HAVE_double_compare_and_swap_full

Definition at line 262 of file aarch64.h.

◆ AO_HAVE_double_compare_and_swap_release

#define AO_HAVE_double_compare_and_swap_release

Definition at line 231 of file aarch64.h.

◆ AO_HAVE_double_load

#define AO_HAVE_double_load

Definition at line 68 of file aarch64.h.

◆ AO_HAVE_double_load_acquire

#define AO_HAVE_double_load_acquire

Definition at line 90 of file aarch64.h.

◆ AO_HAVE_double_store

#define AO_HAVE_double_store

Definition at line 115 of file aarch64.h.

◆ AO_HAVE_double_store_release

#define AO_HAVE_double_store_release

Definition at line 137 of file aarch64.h.

◆ AO_HAVE_nop_write

#define AO_HAVE_nop_write

Definition at line 28 of file aarch64.h.

Function Documentation

◆ AO_double_compare_and_swap()

AO_INLINE int AO_double_compare_and_swap ( volatile AO_double_t addr,
AO_double_t  old_val,
AO_double_t  new_val 
)

Definition at line 141 of file aarch64.h.

143 {
145 int result = 1;
146
147 do {
148 __asm__ __volatile__("//AO_double_compare_and_swap\n"
149# ifdef __ILP32__
150 " ldxp %w0, %w1, %2\n"
151# else
152 " ldxp %0, %1, %2\n"
153# endif
154 : "=&r" (tmp.AO_val1), "=&r" (tmp.AO_val2)
155 : "Q" (*addr));
156 if (tmp.AO_val1 != old_val.AO_val1 || tmp.AO_val2 != old_val.AO_val2)
157 break;
158 __asm__ __volatile__(
159# ifdef __ILP32__
160 " stxp %w0, %w2, %w3, %1\n"
161# else
162 " stxp %w0, %2, %3, %1\n"
163# endif
164 : "=&r" (result), "=Q" (*addr)
165 : "r" (new_val.AO_val1), "r" (new_val.AO_val2));
166 } while (AO_EXPECT_FALSE(result));
167 return !result;
168 }
volatile int result
double tmp
#define AO_EXPECT_FALSE(expr)
Definition: atomic_ops.h:193

◆ AO_double_compare_and_swap_acquire()

AO_INLINE int AO_double_compare_and_swap_acquire ( volatile AO_double_t addr,
AO_double_t  old_val,
AO_double_t  new_val 
)

Definition at line 172 of file aarch64.h.

174 {
176 int result = 1;
177
178 do {
179 __asm__ __volatile__("//AO_double_compare_and_swap_acquire\n"
180# ifdef __ILP32__
181 " ldaxp %w0, %w1, %2\n"
182# else
183 " ldaxp %0, %1, %2\n"
184# endif
185 : "=&r" (tmp.AO_val1), "=&r" (tmp.AO_val2)
186 : "Q" (*addr));
187 if (tmp.AO_val1 != old_val.AO_val1 || tmp.AO_val2 != old_val.AO_val2)
188 break;
189 __asm__ __volatile__(
190# ifdef __ILP32__
191 " stxp %w0, %w2, %w3, %1\n"
192# else
193 " stxp %w0, %2, %3, %1\n"
194# endif
195 : "=&r" (result), "=Q" (*addr)
196 : "r" (new_val.AO_val1), "r" (new_val.AO_val2));
197 } while (AO_EXPECT_FALSE(result));
198 return !result;
199 }

◆ AO_double_compare_and_swap_full()

AO_INLINE int AO_double_compare_and_swap_full ( volatile AO_double_t addr,
AO_double_t  old_val,
AO_double_t  new_val 
)

Definition at line 234 of file aarch64.h.

236 {
238 int result = 1;
239
240 do {
241 __asm__ __volatile__("//AO_double_compare_and_swap_full\n"
242# ifdef __ILP32__
243 " ldaxp %w0, %w1, %2\n"
244# else
245 " ldaxp %0, %1, %2\n"
246# endif
247 : "=&r" (tmp.AO_val1), "=&r" (tmp.AO_val2)
248 : "Q" (*addr));
249 if (tmp.AO_val1 != old_val.AO_val1 || tmp.AO_val2 != old_val.AO_val2)
250 break;
251 __asm__ __volatile__(
252# ifdef __ILP32__
253 " stlxp %w0, %w2, %w3, %1\n"
254# else
255 " stlxp %w0, %2, %3, %1\n"
256# endif
257 : "=&r" (result), "=Q" (*addr)
258 : "r" (new_val.AO_val1), "r" (new_val.AO_val2));
259 } while (AO_EXPECT_FALSE(result));
260 return !result;
261 }

◆ AO_double_compare_and_swap_release()

AO_INLINE int AO_double_compare_and_swap_release ( volatile AO_double_t addr,
AO_double_t  old_val,
AO_double_t  new_val 
)

Definition at line 203 of file aarch64.h.

205 {
207 int result = 1;
208
209 do {
210 __asm__ __volatile__("//AO_double_compare_and_swap_release\n"
211# ifdef __ILP32__
212 " ldxp %w0, %w1, %2\n"
213# else
214 " ldxp %0, %1, %2\n"
215# endif
216 : "=&r" (tmp.AO_val1), "=&r" (tmp.AO_val2)
217 : "Q" (*addr));
218 if (tmp.AO_val1 != old_val.AO_val1 || tmp.AO_val2 != old_val.AO_val2)
219 break;
220 __asm__ __volatile__(
221# ifdef __ILP32__
222 " stlxp %w0, %w2, %w3, %1\n"
223# else
224 " stlxp %w0, %2, %3, %1\n"
225# endif
226 : "=&r" (result), "=Q" (*addr)
227 : "r" (new_val.AO_val1), "r" (new_val.AO_val2));
228 } while (AO_EXPECT_FALSE(result));
229 return !result;
230 }

◆ AO_double_load()

AO_INLINE AO_double_t AO_double_load ( const volatile AO_double_t addr)

Definition at line 47 of file aarch64.h.

48 {
50 int status;
51
52 /* Note that STXP cannot be discarded because LD[A]XP is not */
53 /* single-copy atomic (unlike LDREXD for 32-bit ARM). */
54 do {
55 __asm__ __volatile__("//AO_double_load\n"
56# ifdef __ILP32__
57 " ldxp %w0, %w1, %3\n"
58 " stxp %w2, %w0, %w1, %3"
59# else
60 " ldxp %0, %1, %3\n"
61 " stxp %w2, %0, %1, %3"
62# endif
63 : "=&r" (result.AO_val1), "=&r" (result.AO_val2), "=&r" (status)
64 : "Q" (*addr));
65 } while (AO_EXPECT_FALSE(status));
66 return result;
67 }

◆ AO_double_load_acquire()

AO_INLINE AO_double_t AO_double_load_acquire ( const volatile AO_double_t addr)

Definition at line 71 of file aarch64.h.

72 {
74 int status;
75
76 do {
77 __asm__ __volatile__("//AO_double_load_acquire\n"
78# ifdef __ILP32__
79 " ldaxp %w0, %w1, %3\n"
80 " stxp %w2, %w0, %w1, %3"
81# else
82 " ldaxp %0, %1, %3\n"
83 " stxp %w2, %0, %1, %3"
84# endif
85 : "=&r" (result.AO_val1), "=&r" (result.AO_val2), "=&r" (status)
86 : "Q" (*addr));
87 } while (AO_EXPECT_FALSE(status));
88 return result;
89 }

◆ AO_double_store()

AO_INLINE void AO_double_store ( volatile AO_double_t addr,
AO_double_t  value 
)

Definition at line 93 of file aarch64.h.

94 {
95 AO_double_t old_val;
96 int status;
97
98 do {
99 __asm__ __volatile__("//AO_double_store\n"
100# ifdef __ILP32__
101 " ldxp %w0, %w1, %3\n"
102 " stxp %w2, %w4, %w5, %3"
103# else
104 " ldxp %0, %1, %3\n"
105 " stxp %w2, %4, %5, %3"
106# endif
107 : "=&r" (old_val.AO_val1), "=&r" (old_val.AO_val2), "=&r" (status),
108 "=Q" (*addr)
109 : "r" (value.AO_val1), "r" (value.AO_val2));
110 /* Compared to the arm.h implementation, the 'cc' (flags) are */
111 /* not clobbered because A64 has no concept of conditional */
112 /* execution. */
113 } while (AO_EXPECT_FALSE(status));
114 }

◆ AO_double_store_release()

AO_INLINE void AO_double_store_release ( volatile AO_double_t addr,
AO_double_t  value 
)

Definition at line 118 of file aarch64.h.

119 {
120 AO_double_t old_val;
121 int status;
122
123 do {
124 __asm__ __volatile__("//AO_double_store_release\n"
125# ifdef __ILP32__
126 " ldxp %w0, %w1, %3\n"
127 " stlxp %w2, %w4, %w5, %3"
128# else
129 " ldxp %0, %1, %3\n"
130 " stlxp %w2, %4, %5, %3"
131# endif
132 : "=&r" (old_val.AO_val1), "=&r" (old_val.AO_val2), "=&r" (status),
133 "=Q" (*addr)
134 : "r" (value.AO_val1), "r" (value.AO_val2));
135 } while (AO_EXPECT_FALSE(status));
136 }

◆ AO_nop_write()

AO_INLINE void AO_nop_write ( void  )

Definition at line 24 of file aarch64.h.

25 {
26 __asm__ __volatile__("dmb ishst" : : : "memory");
27 }