sparc: Use atomic compiler builtins on sparc
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 12 Nov 2019 19:11:10 +0000 (19:11 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 27 Nov 2019 13:31:13 +0000 (10:31 -0300)
commit3b5ebe85aabfa44583a18a7ef51bc4d387e362c1
tree8853a1bcbe48f93c1e696ae89e503922845c6e8c
parent5d9b7b9fa734c5381e0295c85c0e40520d9f6063
sparc: Use atomic compiler builtins on sparc

This patch removes the arch-specific atomic instruction, relying on
compiler builtins.  The __sparc32_atomic_locks support is removed
and a configure check is added to check if compiler uses libatomic
to implement CAS.

It also removes the sparc specific sem_* and pthread_barrier_*
implementations.  It in turn allows buidling against a LEON3/LEON4
sparcv8 target, although it will still be incompatible with generic
sparcv9.

Checked on sparcv9-linux-gnu and sparc64-linux-gnu.  I also checked
with build against sparcv8-linux-gnu with -mcpu=leon3.

Tested-by: Andreas Larsson <andreas@gaisler.com>
16 files changed:
sysdeps/sparc/Makefile
sysdeps/sparc/atomic-machine.h [new file with mode: 0644]
sysdeps/sparc/cpu_relax.c [moved from sysdeps/sparc/sparc64/cpu_relax.c with 92% similarity]
sysdeps/sparc/sparc32/atomic-machine.h [deleted file]
sysdeps/sparc/sparc32/configure
sysdeps/sparc/sparc32/configure.ac
sysdeps/sparc/sparc32/lowlevellock.c [deleted file]
sysdeps/sparc/sparc32/pthread_barrier_wait.c [deleted file]
sysdeps/sparc/sparc32/sem_post.c [deleted file]
sysdeps/sparc/sparc32/sem_waitcommon.c [deleted file]
sysdeps/sparc/sparc32/sparcv9/Makefile
sysdeps/sparc/sparc32/sparcv9/atomic-machine.h [deleted file]
sysdeps/sparc/sparc32/sparcv9/cpu_relax.c [deleted file]
sysdeps/sparc/sparc64/Makefile
sysdeps/sparc/sparc64/atomic-machine.h [deleted file]
sysdeps/unix/sysv/linux/sparc/lowlevellock.h [deleted file]