Comments (9)
While doc/README.txt is not clear about it, AO_REQUIRE_CAS ensures AO_compare_and_swap* are defined (not AO_fetch_compare_and_swap), so it's not a bug.
At the same time, it would be good to add support of AO_fetch_compare_and_swap_full on S390. The right way is to copy-paste-edit AO_compare_and_swap_full in gcc/s390.h. Could you contribute it please?
from libatomic_ops.
Hi, after staring at the code and the z/Architecture documentation I can say that I'm unable to contribute code here. However, I can test stuff on my s390x vm.
from libatomic_ops.
How about this implementation?
AO_INLINE AO_t AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) { __asm __volatile ("csg %0,%2,%1" : "+d" (old), "=Q" (*addr) : "d" (new_val), "m" (*addr) : "cc", "memory"); return old; }
#define AO_HAVE_fetch_compare_and_swap_full
from libatomic_ops.
I've just added a PR for this, which passes libatomic_ops's own four test and my little example from my initial message.
from libatomic_ops.
Thank you. Could you please also temporarily delete AO_compare_and_swap_full and rerun make check
from libatomic_ops.
Hi, it passes too... is that expected? O.o
Also, I'm wondering if these symbols are correct:
With code of PR#21:
atomic_ops.o:
00000000000001c0 T AO_compare_double_and_swap_double_emulation
0000000000000358 T AO_fetch_compare_and_swap_emulation
0000000000000000 B AO_locks
0000000000000000 T AO_pause
0000000000000080 B AO_pt_lock
0000000000000148 T AO_store_full_emulation
U __stack_chk_fail
00000000000000b8 b all_sigs
00000000000000a8 b init_lock
00000000000000b0 b initialized
00000000000000e0 t lock_ool
U select
U sigfillset
U sigprocmask
0000000000000000 d spin_dummy
When removing AO_compare_and_swap_full
:
0000000000000188 T AO_compare_double_and_swap_double_emulation
0000000000000370 T AO_fetch_compare_and_swap_emulation
0000000000000000 B AO_locks
0000000000000000 T AO_pause
0000000000000080 B AO_pt_lock
00000000000000e0 T AO_store_full_emulation
U __stack_chk_fail
00000000000000b8 b all_sigs
00000000000000a8 b init_lock
00000000000000b0 b initialized
U select
U sigfillset
U sigprocmask
0000000000000000 d spin_dummy
from libatomic_ops.
Looks ok.
from libatomic_ops.
The patch (with some modifications) merged to master - see c2edeab
from libatomic_ops.
Also cherry-picked to release-7_4 branch - 148dfd5
from libatomic_ops.
Related Issues (20)
- build error on OS X 10.7: Cannot implement AO_compare_and_swap_full on this architecture HOT 22
- Annoying warning (‘-pedantic’ is not an option that controls warnings) HOT 9
- Option to omit documentation at install HOT 12
- Status of 7.6.0? HOT 21
- riscv support HOT 36
- Test suite fails to build with gcc-7 on amd64 HOT 3
- How can I get libatomic_ops.a ? HOT 3
- coredump with '__atomic_fetch_add' function on aarch64 HOT 2
- [x86 gcc] Missing dx side effect in AO_compare_double_and_swap_double_full HOT 10
- SIGSEGV in test_malloc on Alpine linux/s390x HOT 12
- test_stack fail on linux/arm64 (clang) HOT 13
- FTBFS in the testsuite on riscv64 HOT 6
- Incorrect use of sizeof operator to verify alignment HOT 5
- Downstream libatomic_ops releases (Sep 2021) HOT 26
- Explore existing changes in forks (Nov 2021) HOT 3
- test_malloc abort on sparc HOT 3
- Downstream libatomic_ops releases (Aug 2022) HOT 18
- Outdated config.guess Files HOT 3
- Downstream libatomic_ops release (Mar 2023) HOT 24
- Undefined reference to AO_pt_lock on Ubuntu 22.04 when building with configure and clang-16 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libatomic_ops.