summaryrefslogtreecommitdiffstats
path: root/lib/libcompiler_rt/__sync_fetch_and_add_8.c
Commit message (Collapse)AuthorAgeFilesLines
* Unbreak <stdatomic.h> on ARM + Clang.ed2013-04-271-1/+1
| | | | | | | | | | | Clang only supports atomic operations for ARMv6. For non-ARMv6, we still need to emit these functions. Clang's prototype for these functions slightly differs, as it is truly based on GCC's documentation. It requires the use of signed types, but also requires varargs. Still, we are not allowed to simply implement this function directly. Cleverly work around this by implementing it under a different name and using __strong_reference().
* Add locally implemented atomic intrinsics to libcompiler_rt.ed2011-12-271-0/+6
The built-in atomic operations are not implemented in our version of GCC 4.2 for the ARM and MIPS architectures. Instead of emitting locked instructions, they generate calls to functions that can be implemented in the C runtime. Only implement the atomic operations that are used by <stdatomic.h> for datatype sizes that are supported by atomic(9). This means that on these architectures, we can only use atomic operations on 32-bits and 64-bits variables, which is typically sufficient. This makes <stdatomic.h> work on all architectures except MIPS, since MIPS and SPARC64 still use libgcc. Converting these architectures to libcompiler_rt is on my todo list.
OpenPOWER on IntegriCloud