PAPI 7.1.0.0
Loading...
Searching...
No Matches
riscv.h
Go to the documentation of this file.
1/*
2 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
3 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
4 *
5 * Permission is hereby granted to use or copy this program
6 * for any purpose, provided the above notices are retained on all copies.
7 * Permission to modify the code and to distribute modified code is granted,
8 * provided the above notices are retained, and a notice that the code was
9 * modified is included with the above copyright notice.
10 */
11
12#if defined(__clang__) || defined(AO_PREFER_BUILTIN_ATOMICS)
13 /* All __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros are still missing. */
14 /* The operations are lock-free even for the types smaller than word. */
15# define AO_GCC_FORCE_HAVE_CAS
16#else
17
18 /* As of gcc-7.5, CAS and arithmetic atomic operations for char and */
19 /* short are supported by the compiler but require -latomic flag. */
20# if !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1)
21# define AO_NO_char_ARITHM
22# endif
23# if !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2)
24# define AO_NO_short_ARITHM
25# endif
26#endif /* !__clang__ */
27
28#include "generic.h"
29
30#undef AO_GCC_FORCE_HAVE_CAS
31#undef AO_NO_char_ARITHM
32#undef AO_NO_short_ARITHM