From 1cd6e20de6e40ead3795087811f151f00b06e016 Mon Sep 17 00:00:00 2001 From: amacleod Date: Sun, 6 Nov 2011 14:55:48 +0000 Subject: Check in patch/merge from cxx-mem-model Branch git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181031 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/expr.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gcc/expr.h') diff --git a/gcc/expr.h b/gcc/expr.h index 1bf1369ac96..1623ad97a73 100644 --- a/gcc/expr.h +++ b/gcc/expr.h @@ -212,11 +212,17 @@ int can_conditionally_move_p (enum machine_mode mode); rtx emit_conditional_add (rtx, enum rtx_code, rtx, rtx, enum machine_mode, rtx, rtx, enum machine_mode, int); -rtx expand_val_compare_and_swap (rtx, rtx, rtx, rtx); -rtx expand_bool_compare_and_swap (rtx, rtx, rtx, rtx); rtx expand_sync_operation (rtx, rtx, enum rtx_code); rtx expand_sync_fetch_operation (rtx, rtx, enum rtx_code, bool, rtx); -rtx expand_sync_lock_test_and_set (rtx, rtx, rtx); + +rtx expand_atomic_exchange (rtx, rtx, rtx, enum memmodel); +rtx expand_atomic_load (rtx, rtx, enum memmodel); +rtx expand_atomic_store (rtx, rtx, enum memmodel); +rtx expand_atomic_fetch_op (rtx, rtx, rtx, enum rtx_code, enum memmodel, + bool); +void expand_atomic_thread_fence (enum memmodel); +void expand_atomic_signal_fence (enum memmodel); + /* Functions from expmed.c: */ @@ -248,6 +254,7 @@ extern void expand_builtin_setjmp_receiver (rtx); extern rtx expand_builtin_saveregs (void); extern void expand_builtin_trap (void); extern rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, enum machine_mode); +extern void expand_builtin_mem_thread_fence (enum memmodel); /* Functions from expr.c: */ -- cgit v1.2.1 From 8808bf16125e1bea5cd2e969d19a53b9618593f1 Mon Sep 17 00:00:00 2001 From: amacleod Date: Mon, 7 Nov 2011 20:06:39 +0000 Subject: 2011-11-07 Andrew MacLeod libstdc++-v3 * include/bits/atomic_base.h (atomic_thread_fence): Call builtin. (atomic_signal_fence): Call builtin. (atomic_flag::test_and_set): Call __atomic_exchange when it is lockfree, otherwise fall back to call __sync_lock_test_and_set. (atomic_flag::clear): Call __atomic_store when it is lockfree, otherwise fall back to call __sync_lock_release. gcc * doc/extend.texi: Docuemnt behaviour change for __atomic_exchange and __atomic_store. * optabs.c (expand_atomic_exchange): Expand to __sync_lock_test_and_set only when originated from that builtin. (expand_atomic_store): Expand to __sync_lock_release when originated from that builtin. * builtins.c (expand_builtin_sync_lock_test_and_set): Add flag that expand_atomic_exchange call originated from here. (expand_builtin_sync_lock_release): Add flag that expand_atomic_store call originated from here. (expand_builtin_atomic_exchange): Add origination flag. (expand_builtin_atomic_store): Add origination flag. * expr.h (expand_atomic_exchange, expand_atomic_store): Add boolean parameters to indicate implementation fall back options. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181111 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/expr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/expr.h') diff --git a/gcc/expr.h b/gcc/expr.h index 1623ad97a73..2cc8152c740 100644 --- a/gcc/expr.h +++ b/gcc/expr.h @@ -215,9 +215,9 @@ rtx emit_conditional_add (rtx, enum rtx_code, rtx, rtx, enum machine_mode, rtx expand_sync_operation (rtx, rtx, enum rtx_code); rtx expand_sync_fetch_operation (rtx, rtx, enum rtx_code, bool, rtx); -rtx expand_atomic_exchange (rtx, rtx, rtx, enum memmodel); +rtx expand_atomic_exchange (rtx, rtx, rtx, enum memmodel, bool); rtx expand_atomic_load (rtx, rtx, enum memmodel); -rtx expand_atomic_store (rtx, rtx, enum memmodel); +rtx expand_atomic_store (rtx, rtx, enum memmodel, bool); rtx expand_atomic_fetch_op (rtx, rtx, rtx, enum rtx_code, enum memmodel, bool); void expand_atomic_thread_fence (enum memmodel); -- cgit v1.2.1