summaryrefslogtreecommitdiffstats
path: root/lib/libcompiler_rt
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2013-06-08 13:22:53 +0000
committered <ed@FreeBSD.org>2013-06-08 13:22:53 +0000
commitbf96f17d6fd96b6131ace044bb51efb86a5b07b6 (patch)
treedeab0f298b585bde943de2a7460ce7a23c3b1743 /lib/libcompiler_rt
parent10554f30575cd190e163e334156c6270c2e88a48 (diff)
downloadFreeBSD-src-bf96f17d6fd96b6131ace044bb51efb86a5b07b6.zip
FreeBSD-src-bf96f17d6fd96b6131ace044bb51efb86a5b07b6.tar.gz
Use improved __sync_*() intrinsics for MIPS in userspace as well.
r251524 introduced custom tailored versions for MIPS of these functions for kernel-space code. We can just reuse them in userspace as well.
Diffstat (limited to 'lib/libcompiler_rt')
-rw-r--r--lib/libcompiler_rt/Makefile15
-rw-r--r--lib/libcompiler_rt/__sync_fetch_and_add_8.c6
-rw-r--r--lib/libcompiler_rt/__sync_fetch_and_and_8.c7
-rw-r--r--lib/libcompiler_rt/__sync_fetch_and_or_8.c7
-rw-r--r--lib/libcompiler_rt/__sync_fetch_and_sub_8.c6
-rw-r--r--lib/libcompiler_rt/__sync_fetch_and_xor_8.c7
-rw-r--r--lib/libcompiler_rt/__sync_lock_test_and_set_8.c7
-rw-r--r--lib/libcompiler_rt/__sync_val_compare_and_swap_8.c6
8 files changed, 5 insertions, 56 deletions
diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile
index 83c4ea3..a02877c 100644
--- a/lib/libcompiler_rt/Makefile
+++ b/lib/libcompiler_rt/Makefile
@@ -157,7 +157,7 @@ SRCF+= divsi3 \
.endif
# FreeBSD-specific atomic intrinsics.
-.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips"
+.if ${MACHINE_CPUARCH} == "arm"
SRCF+= __sync_fetch_and_add_4 \
__sync_fetch_and_and_4 \
__sync_fetch_and_or_4 \
@@ -166,15 +166,10 @@ SRCF+= __sync_fetch_and_add_4 \
__sync_lock_test_and_set_4 \
__sync_synchronize \
__sync_val_compare_and_swap_4
-.endif
-.if ${MACHINE_ARCH:Mmips64*} != ""
-SRCF+= __sync_fetch_and_add_8 \
- __sync_fetch_and_and_8 \
- __sync_fetch_and_or_8 \
- __sync_fetch_and_sub_8 \
- __sync_fetch_and_xor_8 \
- __sync_lock_test_and_set_8 \
- __sync_val_compare_and_swap_8
+.elif ${MACHINE_CPUARCH} == "mips"
+.PATH: ${.CURDIR}/../../sys/mips/mips
+
+SRCF+= stdatomic
.endif
.for file in ${SRCF}
diff --git a/lib/libcompiler_rt/__sync_fetch_and_add_8.c b/lib/libcompiler_rt/__sync_fetch_and_add_8.c
deleted file mode 100644
index 2738d5d..0000000
--- a/lib/libcompiler_rt/__sync_fetch_and_add_8.c
+++ /dev/null
@@ -1,6 +0,0 @@
-/* $FreeBSD$ */
-#define NAME __sync_fetch_and_add_8
-#define TYPE int64_t
-#define FETCHADD(x, y) atomic_fetchadd_64(x, y)
-
-#include "__sync_fetch_and_op_n.h"
diff --git a/lib/libcompiler_rt/__sync_fetch_and_and_8.c b/lib/libcompiler_rt/__sync_fetch_and_and_8.c
deleted file mode 100644
index f681785..0000000
--- a/lib/libcompiler_rt/__sync_fetch_and_and_8.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $FreeBSD$ */
-#define NAME __sync_fetch_and_and_8
-#define TYPE int64_t
-#define CMPSET atomic_cmpset_64
-#define EXPRESSION t & value
-
-#include "__sync_fetch_and_op_n.h"
diff --git a/lib/libcompiler_rt/__sync_fetch_and_or_8.c b/lib/libcompiler_rt/__sync_fetch_and_or_8.c
deleted file mode 100644
index c88a37b..0000000
--- a/lib/libcompiler_rt/__sync_fetch_and_or_8.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $FreeBSD$ */
-#define NAME __sync_fetch_and_or_8
-#define TYPE int64_t
-#define CMPSET atomic_cmpset_64
-#define EXPRESSION t | value
-
-#include "__sync_fetch_and_op_n.h"
diff --git a/lib/libcompiler_rt/__sync_fetch_and_sub_8.c b/lib/libcompiler_rt/__sync_fetch_and_sub_8.c
deleted file mode 100644
index 4f239b3..0000000
--- a/lib/libcompiler_rt/__sync_fetch_and_sub_8.c
+++ /dev/null
@@ -1,6 +0,0 @@
-/* $FreeBSD$ */
-#define NAME __sync_fetch_and_sub_8
-#define TYPE int64_t
-#define FETCHADD(x, y) atomic_fetchadd_64(x, -(y))
-
-#include "__sync_fetch_and_op_n.h"
diff --git a/lib/libcompiler_rt/__sync_fetch_and_xor_8.c b/lib/libcompiler_rt/__sync_fetch_and_xor_8.c
deleted file mode 100644
index be677f57..0000000
--- a/lib/libcompiler_rt/__sync_fetch_and_xor_8.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $FreeBSD$ */
-#define NAME __sync_fetch_and_xor_8
-#define TYPE int64_t
-#define CMPSET atomic_cmpset_64
-#define EXPRESSION t ^ value
-
-#include "__sync_fetch_and_op_n.h"
diff --git a/lib/libcompiler_rt/__sync_lock_test_and_set_8.c b/lib/libcompiler_rt/__sync_lock_test_and_set_8.c
deleted file mode 100644
index 83c1a6a..0000000
--- a/lib/libcompiler_rt/__sync_lock_test_and_set_8.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $FreeBSD$ */
-#define NAME __sync_lock_test_and_set_8
-#define TYPE int64_t
-#define CMPSET atomic_cmpset_64
-#define EXPRESSION value
-
-#include "__sync_fetch_and_op_n.h"
diff --git a/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c b/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c
deleted file mode 100644
index 6b7a17d..0000000
--- a/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c
+++ /dev/null
@@ -1,6 +0,0 @@
-/* $FreeBSD$ */
-#define NAME __sync_val_compare_and_swap_8
-#define TYPE int64_t
-#define CMPSET atomic_cmpset_64
-
-#include "__sync_val_compare_and_swap_n.h"
OpenPOWER on IntegriCloud