Commit Graph

9 Commits

Author SHA1 Message Date
Ivan Grokhotkov
bd598e36ea newlib: stdatomic: implement missing "op_fetch", "nand" builtins
* Adds implementations of __{atomic,sync}_nand_fetch_n. These builtins
  were implemented for other operations but were not defined for NAND.
* Adds implementation of __atomic_OP_fetch_n for all OPs.
* Adds implementation of __sync_OP_and_fetch_n for all OPs.

Reported in https://github.com/espressif/arduino-esp32/issues/5948
2021-12-21 02:16:02 +01:00
Andrei Safronov
6a57c4d5d5 newlib: fix clang atomics
Correction of the SYNC_LOCK_* macros in stdatomic
2021-11-02 16:24:18 +01:00
Scott Mabin
710c1f2fad remove __clang ifdef around atomic emulation
* CI errors led me to believe these were needed, but as it turns out the
load/store intrinsics are required even when idf is built by gcc when
linking to a clang based project.
* remove ... postfix inside `SYNC_LOCK_TEST_AND_SET` expansion
2021-11-02 16:24:18 +01:00
Scott Mabin
b01c197505 newlib: provide missing atomic libcalls
Provide emulated atomic load & store libcalls for u8, u16 & u32 integer
types. This is required when building with Clang as llvm does not lower
these operations to native load / stores, where as gcc does.

Provide `sync_lock_test_and_set` atomic implementations for all
supported integer types.

Closes https://github.com/espressif/esp-idf/issues/7591.
Closes https://github.com/espressif/esp-idf/issues/7592.
2021-11-02 16:24:18 +01:00
Andrei Safronov
de5e0fa3bd newlib,clang: implement __sync_* atomics for clang/llvm toolchain. 2021-11-02 16:24:18 +01:00
Ivan Grokhotkov
d4f2e03e4a newlib: stdatomic: emulate 64-bit atomics on 32-bit SMP SoCs
Closes https://github.com/espressif/esp-idf/issues/3163
2021-11-02 16:24:18 +01:00
Ivan Grokhotkov
be520f975a newlib: stdatomic: fix prototypes, don't disable compiler warnings 2021-11-02 16:24:18 +01:00
Sachin Parekh
2250da111e stdatomic: Implemented legacy __sync APIs and __atomic_exchange_n
These APIs are used when the architecture doesn't have atomic
instruction support

Closes https://github.com/espressif/esp-idf/issues/6463
2021-11-02 16:24:18 +01:00
Renz Bagaporo
5f2fabb2b1 arch: move stdatomic 2021-11-02 16:24:18 +01:00