1 Nov 2011 01:39
[cxx-mem-model] Use __atomic builtins for OpenMP
Richard Henderson <rth <at> redhat.com>
2011-11-01 00:39:28 GMT
2011-11-01 00:39:28 GMT
I do realize that there's technically a regression for i486, since we'll no longer look for xadd without the i586 cmpxchg. I really can't imagine that anyone cares. Tested on x86_64-linux. r~
Use __atomic builtins for #pragma omp atomic.
* omp-low.c (expand_omp_atomic_fetch_op): Don't test individual
fetch_op optabs, only test can_compare_and_swap_p. Use __atomic
builtins instead of __sync builtins.
* optabs.h (get_atomic_op_for_code): Remove decl.
(struct atomic_op_functions): Move to...
* optabs.c: ... here.
(get_atomic_op_for_code): Make static.
testsuite/
* lib/target-supports.exp (check_effective_target_cas_char): New.
(check_effective_target_cas_int): New.
* c-c++-common/gomp/atomic-10.c: Use cas_int; match __atomic builtin.
* c-c++-common/gomp/atomic-3.c: Likewise.
* c-c++-common/gomp/atomic-9.c: Likewise.
* gcc.dg/gomp/atomic-1.c, gcc.dg/gomp/atomic-2.c,
gcc.dg/gomp/atomic-3.c, gcc.dg/gomp/atomic-4.c, gcc.dg/gomp/atomic-7.c,
gcc.dg/gomp/atomic-8.c, gcc.dg/gomp/atomic-9.c,
gcc.dg/gomp/atomic-10.c, gcc.dg/gomp/atomic-12.c,
(Continue reading)
RSS Feed