libatomic_ops-7.4.4 (#1346524)
This commit is contained in:
parent
d849a4a7f5
commit
f99fb88db9
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
/libatomic_ops-7.4.2.tar.gz
|
||||
/libatomic_ops-7.4.4.tar.gz
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
From c634636a66f3afd885b30d0287c78a8b223a4c19 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Raiskup <praiskup@redhat.com>
|
||||
Date: Tue, 13 May 2014 13:46:23 +0200
|
||||
Subject: [PATCH 02/20] Fix makefile preventing AO_pause undefined in
|
||||
libatomic_ops_gpl
|
||||
|
||||
* src/Makefile.am (libatomic_ops_gpl_la_LIBADD): New dependency.
|
||||
---
|
||||
src/Makefile.am | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index 7d586e9..d2cf718 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -12,6 +12,7 @@ libatomic_ops_la_LDFLAGS = -version-info 1:3:0 -no-undefined
|
||||
|
||||
libatomic_ops_gpl_la_SOURCES = atomic_ops_stack.c atomic_ops_malloc.c
|
||||
libatomic_ops_gpl_la_LDFLAGS = -version-info 1:3:0 -no-undefined
|
||||
+libatomic_ops_gpl_la_LIBADD = libatomic_ops.la
|
||||
|
||||
EXTRA_DIST = Makefile.msft atomic_ops/sysdeps/README \
|
||||
atomic_ops/generalize-arithm.template \
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
From 952543ab656f8cf787a39018b8c8b41c475d8902 Mon Sep 17 00:00:00 2001
|
||||
From: Ivan Maidanski <ivmai@mail.ru>
|
||||
Date: Fri, 13 Jun 2014 12:17:08 +0400
|
||||
Subject: [PATCH 05/20] Fix missing casts to match printf format specifier in
|
||||
test_atomic
|
||||
|
||||
* tests/test_atomic.c (test_and_set_thr): Add missing casts to long
|
||||
for locked_counter (which is unsigned long) to match printf format
|
||||
specifier.
|
||||
---
|
||||
tests/test_atomic.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/test_atomic.c b/tests/test_atomic.c
|
||||
index 86fede1..b063a92 100644
|
||||
--- a/tests/test_atomic.c
|
||||
+++ b/tests/test_atomic.c
|
||||
@@ -148,7 +148,7 @@ void * test_and_set_thr(void * id)
|
||||
if (locked_counter != 1)
|
||||
{
|
||||
fprintf(stderr, "Test and set failure 1, counter = %ld, id = %d\n",
|
||||
- locked_counter, (int)(AO_PTRDIFF_T)id);
|
||||
+ (long)locked_counter, (int)(AO_PTRDIFF_T)id);
|
||||
abort();
|
||||
}
|
||||
locked_counter *= 2;
|
||||
@@ -158,7 +158,7 @@ void * test_and_set_thr(void * id)
|
||||
if (locked_counter != 1)
|
||||
{
|
||||
fprintf(stderr, "Test and set failure 2, counter = %ld, id = %d\n",
|
||||
- locked_counter, (int)(AO_PTRDIFF_T)id);
|
||||
+ (long)locked_counter, (int)(AO_PTRDIFF_T)id);
|
||||
abort();
|
||||
}
|
||||
--locked_counter;
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@ -1,76 +0,0 @@
|
||||
From 658d0711f76ed015aafa2f50604d9ff74e79d28c Mon Sep 17 00:00:00 2001
|
||||
From: Ivan Maidanski <ivmai@mail.ru>
|
||||
Date: Fri, 13 Jun 2014 16:35:55 +0400
|
||||
Subject: [PATCH 06/20] Eliminate 'variable set but not used' Cppcheck warnings
|
||||
in test_stack
|
||||
|
||||
* tests/test_stack.c (run_one_test): Define "j" local variable only
|
||||
if VERBOSE.
|
||||
* tests/test_stack.c (main): Do not define "sum" local variable (and
|
||||
don not compute the sum) if NO_TIMES.
|
||||
---
|
||||
tests/test_stack.c | 25 ++++++++++++++-----------
|
||||
1 file changed, 14 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/tests/test_stack.c b/tests/test_stack.c
|
||||
index 8170e5c..a3c5c30 100644
|
||||
--- a/tests/test_stack.c
|
||||
+++ b/tests/test_stack.c
|
||||
@@ -175,9 +175,9 @@ volatile AO_t ops_performed = 0;
|
||||
list_element * t[MAX_NTHREADS + 1];
|
||||
int index = (int)(size_t)arg;
|
||||
int i;
|
||||
- int j = 0;
|
||||
-
|
||||
# ifdef VERBOSE
|
||||
+ int j = 0;
|
||||
+
|
||||
printf("starting thread %d\n", index);
|
||||
# endif
|
||||
while (fetch_and_add(&ops_performed, index + 1) + index + 1 < LIMIT)
|
||||
@@ -195,7 +195,9 @@ volatile AO_t ops_performed = 0;
|
||||
{
|
||||
AO_stack_push(&the_list, (AO_t *)t[i]);
|
||||
}
|
||||
- j += (index + 1);
|
||||
+# ifdef VERBOSE
|
||||
+ j += index + 1;
|
||||
+# endif
|
||||
}
|
||||
# ifdef VERBOSE
|
||||
printf("finished thread %d: %d total ops\n", index, j);
|
||||
@@ -303,22 +305,23 @@ int main(int argc, char **argv)
|
||||
}
|
||||
for (nthreads = 1; nthreads <= max_nthreads; ++nthreads)
|
||||
{
|
||||
- unsigned long sum = 0;
|
||||
+# ifndef NO_TIMES
|
||||
+ unsigned long sum = 0;
|
||||
+# endif
|
||||
|
||||
printf("About %d pushes + %d pops in %d threads:",
|
||||
LIMIT, LIMIT, nthreads);
|
||||
- for (exper_n = 0; exper_n < N_EXPERIMENTS; ++exper_n)
|
||||
- {
|
||||
+# ifndef NO_TIMES
|
||||
+ for (exper_n = 0; exper_n < N_EXPERIMENTS; ++exper_n) {
|
||||
# if defined(VERBOSE)
|
||||
printf(" [%lu]", times[nthreads][exper_n]);
|
||||
# endif
|
||||
sum += times[nthreads][exper_n];
|
||||
}
|
||||
-# ifndef NO_TIMES
|
||||
- printf(" %lu msecs\n", (sum + N_EXPERIMENTS/2)/N_EXPERIMENTS);
|
||||
-# else
|
||||
- printf(" completed\n");
|
||||
-# endif
|
||||
+ printf(" %lu msecs\n", (sum + N_EXPERIMENTS/2)/N_EXPERIMENTS);
|
||||
+# else
|
||||
+ printf(" completed\n");
|
||||
+# endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@ -1,141 +0,0 @@
|
||||
From e45146b18c19ba39b8f8631619dda26f00dba04c Mon Sep 17 00:00:00 2001
|
||||
From: Kochin Chang <kochinc@outlook.com>
|
||||
Date: Fri, 12 Sep 2014 13:35:53 -0400
|
||||
Subject: [PATCH 07/20] Fix missing output folder on making auto-generated
|
||||
headers (Automake)
|
||||
|
||||
Create the directories before sed needs them (otherwise build fails
|
||||
when sed tries to redirect output to a non-existent directory in case
|
||||
of build root folder is not identical to source root folder).
|
||||
|
||||
* src/Makefile.am (atomic_ops/generalize-small.h,
|
||||
atomic_ops/generalize-arithm.h, atomic_ops/sysdeps/ao_t_is_int.h,
|
||||
atomic_ops/sysdeps/gcc/generic-arithm.h,
|
||||
atomic_ops/sysdeps/loadstore/*.h): Add mkdir for output folder.
|
||||
---
|
||||
src/Makefile.am | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index d2cf718..fc09b27 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -103,6 +103,7 @@ nobase_private_HEADERS = atomic_ops/ao_version.h \
|
||||
atomic_ops/sysdeps/sunc/x86.h
|
||||
|
||||
atomic_ops/generalize-small.h: atomic_ops/generalize-small.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g $? > $@
|
||||
sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g $? >> $@
|
||||
sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g $? >> $@
|
||||
@@ -110,12 +111,14 @@ atomic_ops/generalize-small.h: atomic_ops/generalize-small.template
|
||||
sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g $? >> $@
|
||||
|
||||
atomic_ops/generalize-arithm.h: atomic_ops/generalize-arithm.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g $? > $@
|
||||
sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g $? >> $@
|
||||
sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g $? >> $@
|
||||
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g $? >> $@
|
||||
|
||||
atomic_ops/sysdeps/ao_t_is_int.h: atomic_ops/sysdeps/ao_t_is_int.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:_XBAR::g $? > $@
|
||||
sed -e s:XBAR:full:g $? >> $@
|
||||
sed -e s:XBAR:acquire:g $? >> $@
|
||||
@@ -125,6 +128,7 @@ atomic_ops/sysdeps/ao_t_is_int.h: atomic_ops/sysdeps/ao_t_is_int.template
|
||||
|
||||
atomic_ops/sysdeps/gcc/generic-arithm.h: \
|
||||
atomic_ops/sysdeps/gcc/generic-arithm.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:_XBAR::g -e s:XGCCBAR:RELAXED:g \
|
||||
-e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g $? > $@
|
||||
sed -e s:_XBAR::g -e s:XGCCBAR:RELAXED:g \
|
||||
@@ -160,6 +164,7 @@ atomic_ops/sysdeps/gcc/generic-arithm.h: \
|
||||
|
||||
atomic_ops/sysdeps/gcc/generic-small.h: \
|
||||
atomic_ops/sysdeps/gcc/generic-small.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g $? > $@
|
||||
sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g $? >> $@
|
||||
sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g $? >> $@
|
||||
@@ -167,6 +172,7 @@ atomic_ops/sysdeps/gcc/generic-small.h: \
|
||||
|
||||
atomic_ops/sysdeps/loadstore/ordered_loads_only.h: \
|
||||
atomic_ops/sysdeps/loadstore/ordered_loads_only.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g $? > $@
|
||||
sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g $? >> $@
|
||||
sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g $? >> $@
|
||||
@@ -175,6 +181,7 @@ atomic_ops/sysdeps/loadstore/ordered_loads_only.h: \
|
||||
|
||||
atomic_ops/sysdeps/loadstore/ordered_stores_only.h: \
|
||||
atomic_ops/sysdeps/loadstore/ordered_stores_only.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g $? > $@
|
||||
sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g $? >> $@
|
||||
sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g $? >> $@
|
||||
@@ -183,48 +190,60 @@ atomic_ops/sysdeps/loadstore/ordered_stores_only.h: \
|
||||
|
||||
atomic_ops/sysdeps/loadstore/acquire_release_volatile.h: \
|
||||
atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h: \
|
||||
atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h: \
|
||||
atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h: \
|
||||
atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/atomic_load.h: \
|
||||
atomic_ops/sysdeps/loadstore/atomic_load.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/char_atomic_load.h: \
|
||||
atomic_ops/sysdeps/loadstore/atomic_load.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/int_atomic_load.h: \
|
||||
atomic_ops/sysdeps/loadstore/atomic_load.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/short_atomic_load.h: \
|
||||
atomic_ops/sysdeps/loadstore/atomic_load.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/atomic_store.h: \
|
||||
atomic_ops/sysdeps/loadstore/atomic_store.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/char_atomic_store.h: \
|
||||
atomic_ops/sysdeps/loadstore/atomic_store.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/int_atomic_store.h: \
|
||||
atomic_ops/sysdeps/loadstore/atomic_store.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g $? > $@
|
||||
|
||||
atomic_ops/sysdeps/loadstore/short_atomic_store.h: \
|
||||
atomic_ops/sysdeps/loadstore/atomic_store.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g $? > $@
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
From 5cc7d46bd05cfd863c3e8765b908877702e9940a Mon Sep 17 00:00:00 2001
|
||||
From: Ivan Maidanski <ivmai@mail.ru>
|
||||
Date: Sat, 25 Oct 2014 20:58:06 +0400
|
||||
Subject: [PATCH 09/20] Fix missing output folder on making auto-generated test
|
||||
files (Automake)
|
||||
|
||||
* tests/Makefile.am (test_atomic_include.h, list_atomic.c,
|
||||
list_atomic.i): Add mkdir for output folder.
|
||||
---
|
||||
tests/Makefile.am | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 6bfe33c..c8812bb 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -35,6 +35,7 @@ test_malloc_LDADD = $(THREADDLLIBS) \
|
||||
$(top_builddir)/src/libatomic_ops.la
|
||||
|
||||
test_atomic_include.h: test_atomic_include.template
|
||||
+ mkdir -p `dirname $@`
|
||||
sed -e s:XX::g $? > $@
|
||||
sed -e s:XX:_release:g $? >> $@
|
||||
sed -e s:XX:_acquire:g $? >> $@
|
||||
@@ -45,6 +46,7 @@ test_atomic_include.h: test_atomic_include.template
|
||||
sed -e s:XX:_acquire_read:g $? >> $@
|
||||
|
||||
list_atomic.c: list_atomic.template
|
||||
+ mkdir -p `dirname $@`
|
||||
echo "#include \"atomic_ops.h\"" > $@
|
||||
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g -e s:XX::g $? >> $@
|
||||
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g -e s:XX:_release:g $? >> $@
|
||||
@@ -93,6 +95,7 @@ list_atomic.c: list_atomic.template
|
||||
sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s:XX:_dd_acquire_read:g $? >> $@
|
||||
|
||||
list_atomic.i: list_atomic.c
|
||||
+ mkdir -p `dirname $@`
|
||||
$(COMPILE) $? -E > $@
|
||||
|
||||
# Verify list_atomic.c syntax:
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
From 481b4eb85ac49af5b0034930aa375cff05e1b8f9 Mon Sep 17 00:00:00 2001
|
||||
From: Ivan Maidanski <ivmai@mail.ru>
|
||||
Date: Mon, 8 Feb 2016 10:13:47 +0300
|
||||
Subject: [PATCH 15/20] Eliminate 'signed-to-unsigned value extension' compiler
|
||||
warning in AO_malloc
|
||||
|
||||
* src/atomic_ops_malloc.c (msbs): Change type from int to unsigned
|
||||
char.
|
||||
* src/atomic_ops_malloc.c (msb): Change return type from int to
|
||||
unsigned.
|
||||
* src/atomic_ops_malloc.c (msb, AO_malloc): Change type of v, result,
|
||||
log_sz local variables from int to unsigned.
|
||||
---
|
||||
src/atomic_ops_malloc.c | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/atomic_ops_malloc.c b/src/atomic_ops_malloc.c
|
||||
index 60757cf..124c87c 100644
|
||||
--- a/src/atomic_ops_malloc.c
|
||||
+++ b/src/atomic_ops_malloc.c
|
||||
@@ -224,16 +224,18 @@ static void add_chunk_as(void * chunk, unsigned log_sz)
|
||||
}
|
||||
}
|
||||
|
||||
-static const int msbs[16] = {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4};
|
||||
+static const unsigned char msbs[16] = {
|
||||
+ 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4
|
||||
+};
|
||||
|
||||
/* Return the position of the most significant set bit in the */
|
||||
/* argument. */
|
||||
/* We follow the conventions of ffs(), i.e. the least */
|
||||
/* significant bit is number one. */
|
||||
-static int msb(size_t s)
|
||||
+static unsigned msb(size_t s)
|
||||
{
|
||||
- int result = 0;
|
||||
- int v;
|
||||
+ unsigned result = 0;
|
||||
+ unsigned v;
|
||||
if ((s & 0xff) != s) {
|
||||
/* The following is a tricky code ought to be equivalent to */
|
||||
/* "(v = s >> 32) != 0" but suppresses warnings on 32-bit arch's. */
|
||||
@@ -266,7 +268,7 @@ void *
|
||||
AO_malloc(size_t sz)
|
||||
{
|
||||
AO_t *result;
|
||||
- int log_sz;
|
||||
+ unsigned log_sz;
|
||||
|
||||
if (sz > CHUNK_SIZE)
|
||||
return AO_malloc_large(sz);
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
From 54d1da56809b892d2fc521fea0fd41ea8c23e4f2 Mon Sep 17 00:00:00 2001
|
||||
From: James Cowgill <james410@cowgill.org.uk>
|
||||
Date: Thu, 8 Jan 2015 16:00:38 +0000
|
||||
Subject: [PATCH 16/36] Use LLD and SCD instructions on mips64
|
||||
Subject: [PATCH 16/59] Use LLD and SCD instructions on mips64
|
||||
|
||||
---
|
||||
src/atomic_ops/sysdeps/gcc/mips.h | 54 ++++++++++++++++++++++-----------------
|
||||
@ -138,5 +138,5 @@ index a891de6..83a6bd3 100644
|
||||
-/* FIXME: 32-bit ABI is assumed. */
|
||||
-#define AO_T_IS_INT
|
||||
--
|
||||
1.9.3
|
||||
2.7.4
|
||||
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From 133375739ed5dd59bb3f3efeaf9db17f32bf36e1 Mon Sep 17 00:00:00 2001
|
||||
From: Frank Schaefer <frank.schaefer@tekcomms.com>
|
||||
Date: Tue, 9 Jun 2015 17:10:00 -0500
|
||||
Subject: [PATCH 17/20] Fix GCC 5.x compatibility for AArch64 double-wide
|
||||
primitives
|
||||
|
||||
Small change to make aarch64 support work with gcc 5.x. Otherwise it
|
||||
demands gcc -latomic and still fails test_stack.
|
||||
|
||||
* src/atomic_ops/sysdeps/gcc/aarch64.h (AO_double_load,
|
||||
AO_double_load_acquire, AO_double_store, AO_double_store_release,
|
||||
AO_double_compare_and_swap, AO_double_compare_and_swap_acquire,
|
||||
AO_double_compare_and_swap_release, AO_double_compare_and_swap_full):
|
||||
Use assembly implementation even for GCC v5+ (not just GCC 4.x).
|
||||
---
|
||||
src/atomic_ops/sysdeps/gcc/aarch64.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/atomic_ops/sysdeps/gcc/aarch64.h b/src/atomic_ops/sysdeps/gcc/aarch64.h
|
||||
index 54e6d7f..b9624ef 100644
|
||||
--- a/src/atomic_ops/sysdeps/gcc/aarch64.h
|
||||
+++ b/src/atomic_ops/sysdeps/gcc/aarch64.h
|
||||
@@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
/* TODO: Adjust version check on fixing double-wide AO support in GCC. */
|
||||
-#if __GNUC__ == 4
|
||||
+#if __GNUC__ >= 4
|
||||
|
||||
AO_INLINE AO_double_t
|
||||
AO_double_load(const volatile AO_double_t *addr)
|
||||
@@ -194,6 +194,6 @@
|
||||
return !result;
|
||||
}
|
||||
# define AO_HAVE_double_compare_and_swap_full
|
||||
-#endif /* __GNUC__ == 4 */
|
||||
+#endif /* __GNUC__ >= 4 */
|
||||
|
||||
#include "generic.h"
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
From 0f838defa3e466aff725213638f90e850430f2f9 Mon Sep 17 00:00:00 2001
|
||||
From: James Cowgill <james410@cowgill.org.uk>
|
||||
Date: Thu, 8 Jan 2015 16:05:57 +0000
|
||||
Subject: [PATCH 17/36] Remove inclusion of acquire_release_volatile.h on mips
|
||||
|
||||
I'm not entirely sure how this ended up here. It might have been the case
|
||||
that MIPS processors used to do this, but the ISA manuals don't say anything
|
||||
about volatile loads / stores having aquire / release semnatics, so just
|
||||
remove it to be safe.
|
||||
---
|
||||
src/atomic_ops/sysdeps/gcc/mips.h | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h
|
||||
index 83a6bd3..f3796ea 100644
|
||||
--- a/src/atomic_ops/sysdeps/gcc/mips.h
|
||||
+++ b/src/atomic_ops/sysdeps/gcc/mips.h
|
||||
@@ -19,8 +19,6 @@
|
||||
|
||||
#include "../all_aligned_atomic_load_store.h"
|
||||
|
||||
-#include "../loadstore/acquire_release_volatile.h"
|
||||
-
|
||||
#include "../test_and_set_t_is_ao_t.h"
|
||||
|
||||
/* Data dependence does not imply read ordering. */
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 22ca163649571c72852f5892c05a4c1c53d50cc5 Mon Sep 17 00:00:00 2001
|
||||
From: James Cowgill <james410@cowgill.org.uk>
|
||||
Date: Thu, 8 Jan 2015 16:14:22 +0000
|
||||
Subject: [PATCH 18/36] Minor fix of code alignment in mips AO_compare_and_swap
|
||||
|
||||
---
|
||||
src/atomic_ops/sysdeps/gcc/mips.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h
|
||||
index f3796ea..1ad47f2 100644
|
||||
--- a/src/atomic_ops/sysdeps/gcc/mips.h
|
||||
+++ b/src/atomic_ops/sysdeps/gcc/mips.h
|
||||
@@ -127,7 +127,7 @@ AO_test_and_set(volatile AO_TS_t *addr)
|
||||
"1: "
|
||||
AO_MIPS_LL("%0, %1")
|
||||
" bne %0, %4, 2f \n"
|
||||
- " move %0, %3 \n"
|
||||
+ " move %0, %3 \n"
|
||||
AO_MIPS_SC("%0, %1")
|
||||
" .set pop \n"
|
||||
" beqz %0, 1b \n"
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@ -7,15 +7,11 @@ are critical for proper behavior on power system.
|
||||
|
||||
Signed-Off-By: Will Schmidt <will_schmidt at vnet.ibm.com>
|
||||
Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
|
||||
---
|
||||
libatomic_ops/src/atomic_ops/sysdeps/gcc/powerpc.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
Index: libatomic_ops/src/atomic_ops/sysdeps/gcc/powerpc.h
|
||||
===================================================================
|
||||
--- libatomic_ops/src/atomic_ops/sysdeps/gcc/powerpc.h
|
||||
+++ libatomic_ops/src/atomic_ops/sysdeps/gcc/powerpc.h
|
||||
@@ -32,6 +32,8 @@
|
||||
diff -up libatomic_ops-7.4.4/src/atomic_ops/sysdeps/gcc/powerpc.h.gc_ppc64le_force_AO_load libatomic_ops-7.4.4/src/atomic_ops/sysdeps/gcc/powerpc.h
|
||||
--- libatomic_ops-7.4.4/src/atomic_ops/sysdeps/gcc/powerpc.h.gc_ppc64le_force_AO_load 2016-05-24 15:01:55.000000000 -0500
|
||||
+++ libatomic_ops-7.4.4/src/atomic_ops/sysdeps/gcc/powerpc.h 2016-06-17 10:27:10.503593018 -0500
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "../all_aligned_atomic_load_store.h"
|
||||
|
||||
|
||||
129
libatomic_ops-7.4.4-Use-LLD-and-SCD-instructions-on-mips64.patch
Normal file
129
libatomic_ops-7.4.4-Use-LLD-and-SCD-instructions-on-mips64.patch
Normal file
@ -0,0 +1,129 @@
|
||||
diff -up libatomic_ops-7.4.4/src/atomic_ops/sysdeps/gcc/mips.h.0016 libatomic_ops-7.4.4/src/atomic_ops/sysdeps/gcc/mips.h
|
||||
--- libatomic_ops-7.4.4/src/atomic_ops/sysdeps/gcc/mips.h.0016 2016-05-24 15:01:55.000000000 -0500
|
||||
+++ libatomic_ops-7.4.4/src/atomic_ops/sysdeps/gcc/mips.h 2016-06-17 10:25:42.139250860 -0500
|
||||
@@ -15,7 +15,6 @@
|
||||
* FIXME: This should probably make finer distinctions. SGI MIPS is
|
||||
* much more strongly ordered, and in fact closer to sequentially
|
||||
* consistent. This is really aimed at modern embedded implementations.
|
||||
- * It looks to me like this assumes a 32-bit ABI. -HB
|
||||
*/
|
||||
|
||||
#include "../all_aligned_atomic_load_store.h"
|
||||
@@ -25,14 +24,24 @@
|
||||
/* Data dependence does not imply read ordering. */
|
||||
#define AO_NO_DD_ORDERING
|
||||
|
||||
+#ifdef __mips64
|
||||
+# define AO_MIPS_SET_ISA " .set mips3\n"
|
||||
+# define AO_MIPS_LL_1(args) " lld " args "\n"
|
||||
+# define AO_MIPS_SC(args) " scd " args "\n"
|
||||
+#else
|
||||
+# define AO_MIPS_SET_ISA " .set mips2\n"
|
||||
+# define AO_MIPS_LL_1(args) " ll " args "\n"
|
||||
+# define AO_MIPS_SC(args) " sc " args "\n"
|
||||
+# define AO_T_IS_INT
|
||||
+#endif
|
||||
+
|
||||
#ifdef AO_ICE9A1_LLSC_WAR
|
||||
/* ICE9 rev A1 chip (used in very few systems) is reported to */
|
||||
/* have a low-frequency bug that causes LL to fail. */
|
||||
/* To workaround, just issue the second 'LL'. */
|
||||
-# define AO_MIPS_LL_FIX(args_str) \
|
||||
- " ll " args_str "\n"
|
||||
+# define AO_MIPS_LL(args) AO_MIPS_LL_1(args) AO_MIPS_LL_1(args)
|
||||
#else
|
||||
-# define AO_MIPS_LL_FIX(args_str) ""
|
||||
+# define AO_MIPS_LL(args) AO_MIPS_LL_1(args)
|
||||
#endif
|
||||
|
||||
AO_INLINE void
|
||||
@@ -40,7 +49,7 @@ AO_nop_full(void)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
" .set push \n"
|
||||
- " .set mips2 \n"
|
||||
+ AO_MIPS_SET_ISA
|
||||
" .set noreorder \n"
|
||||
" .set nomacro \n"
|
||||
" sync \n"
|
||||
@@ -58,13 +67,13 @@ AO_fetch_and_add(volatile AO_t *addr, AO
|
||||
|
||||
__asm__ __volatile__(
|
||||
" .set push\n"
|
||||
- " .set mips2\n"
|
||||
+ AO_MIPS_SET_ISA
|
||||
" .set noreorder\n"
|
||||
" .set nomacro\n"
|
||||
- "1: ll %0, %2\n"
|
||||
- AO_MIPS_LL_FIX("%0, %2")
|
||||
+ "1: "
|
||||
+ AO_MIPS_LL("%0, %2")
|
||||
" addu %1, %0, %3\n"
|
||||
- " sc %1, %2\n"
|
||||
+ AO_MIPS_SC("%1, %2")
|
||||
" beqz %1, 1b\n"
|
||||
" nop\n"
|
||||
" .set pop "
|
||||
@@ -83,13 +92,13 @@ AO_test_and_set(volatile AO_TS_t *addr)
|
||||
|
||||
__asm__ __volatile__(
|
||||
" .set push\n"
|
||||
- " .set mips2\n"
|
||||
+ AO_MIPS_SET_ISA
|
||||
" .set noreorder\n"
|
||||
" .set nomacro\n"
|
||||
- "1: ll %0, %2\n"
|
||||
- AO_MIPS_LL_FIX("%0, %2")
|
||||
+ "1: "
|
||||
+ AO_MIPS_LL("%0, %2")
|
||||
" move %1, %3\n"
|
||||
- " sc %1, %2\n"
|
||||
+ AO_MIPS_SC("%1, %2")
|
||||
" beqz %1, 1b\n"
|
||||
" nop\n"
|
||||
" .set pop "
|
||||
@@ -112,14 +121,14 @@ AO_test_and_set(volatile AO_TS_t *addr)
|
||||
|
||||
__asm__ __volatile__(
|
||||
" .set push \n"
|
||||
- " .set mips2 \n"
|
||||
+ AO_MIPS_SET_ISA
|
||||
" .set noreorder \n"
|
||||
" .set nomacro \n"
|
||||
- "1: ll %0, %1 \n"
|
||||
- AO_MIPS_LL_FIX("%0, %1")
|
||||
+ "1: "
|
||||
+ AO_MIPS_LL("%0, %1")
|
||||
" bne %0, %4, 2f \n"
|
||||
" move %0, %3 \n"
|
||||
- " sc %0, %1 \n"
|
||||
+ AO_MIPS_SC("%0, %1")
|
||||
" .set pop \n"
|
||||
" beqz %0, 1b \n"
|
||||
" li %2, 1 \n"
|
||||
@@ -140,14 +149,14 @@ AO_fetch_compare_and_swap(volatile AO_t
|
||||
|
||||
__asm__ __volatile__(
|
||||
" .set push\n"
|
||||
- " .set mips2\n"
|
||||
+ AO_MIPS_SET_ISA
|
||||
" .set noreorder\n"
|
||||
" .set nomacro\n"
|
||||
- "1: ll %0, %2\n"
|
||||
- AO_MIPS_LL_FIX("%0, %2")
|
||||
+ "1: "
|
||||
+ AO_MIPS_LL("%0, %2")
|
||||
" bne %0, %4, 2f\n"
|
||||
" move %1, %3\n"
|
||||
- " sc %1, %2\n"
|
||||
+ AO_MIPS_SC("%1, %2")
|
||||
" beqz %1, 1b\n"
|
||||
" nop\n"
|
||||
" .set pop\n"
|
||||
@@ -165,6 +174,3 @@ AO_fetch_compare_and_swap(volatile AO_t
|
||||
/* CAS primitives with acquire, release and full semantics are */
|
||||
/* generated automatically (and AO_int_... primitives are */
|
||||
/* defined properly after the first generalization pass). */
|
||||
-
|
||||
-/* FIXME: 32-bit ABI is assumed. */
|
||||
-#define AO_T_IS_INT
|
||||
@ -1,30 +1,24 @@
|
||||
Name: libatomic_ops
|
||||
Summary: Atomic memory update operations
|
||||
Version: 7.4.2
|
||||
Release: 9%{?dist}
|
||||
Version: 7.4.4
|
||||
Release: 1%{?dist}
|
||||
|
||||
# libatomic_ops MIT, libatomic_ops_gpl GPLv2
|
||||
License: GPLv2 and MIT
|
||||
#URL: http://www.hpl.hp.com/research/linux/atomic_ops/
|
||||
URL: https://github.com/ivmai/libatomic_ops/
|
||||
Source0: http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-%{version}.tar.gz
|
||||
URL: http://www.hboehm.info/gc/
|
||||
#URL: https://github.com/ivmai/libatomic_ops/
|
||||
#Source0: http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-%{version}.tar.gz
|
||||
Source0: http://www.hboehm.info/gc/gc_source/libatomic_ops-%{version}.tar.gz
|
||||
# updated GPLv2 license text
|
||||
Source1: http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
|
||||
|
||||
## upstream patches
|
||||
# 7.4 branch
|
||||
Patch2: 0002-Fix-makefile-preventing-AO_pause-undefined-in-libato.patch
|
||||
Patch5: 0005-Fix-missing-casts-to-match-printf-format-specifier-i.patch
|
||||
Patch6: 0006-Eliminate-variable-set-but-not-used-Cppcheck-warning.patch
|
||||
Patch7: 0007-Fix-missing-output-folder-on-making-auto-generated-h.patch
|
||||
Patch9: 0009-Fix-missing-output-folder-on-making-auto-generated-t.patch
|
||||
Patch15: 0015-Eliminate-signed-to-unsigned-value-extension-compile.patch
|
||||
Patch17: 0017-Fix-GCC-5.x-compatibility-for-AArch64-double-wide-pr.patch
|
||||
|
||||
# master branch
|
||||
Patch116: 0016-Use-LLD-and-SCD-instructions-on-mips64.patch
|
||||
Patch117: 0017-Remove-inclusion-of-acquire_release_volatile.h-on-mi.patch
|
||||
Patch118: 0018-Minor-fix-of-code-alignment-in-mips-AO_compare_and_s.patch
|
||||
#Patch116: 0016-Use-LLD-and-SCD-instructions-on-mips64.patch
|
||||
## rebased for 7.4.4
|
||||
Patch116: libatomic_ops-7.4.4-Use-LLD-and-SCD-instructions-on-mips64.patch
|
||||
|
||||
## upstreamable patches
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1096574
|
||||
@ -112,6 +106,9 @@ make check %{?arch_ignore}
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Jun 17 2016 Rex Dieter <rdieter@fedoraproject.org> - 7.4.4-1
|
||||
- libatomic_ops-7.4.4 (#1346524)
|
||||
|
||||
* Mon Mar 28 2016 Rex Dieter <rdieter@fedoraproject.org> 7.4.2-9
|
||||
- make check fails on test_stack for ppc64le arch (#1096574), drop reference to 0032.patch
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user