From b8a64b7f5d699776983eab2c07125523e96bc6ea Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Thu, 10 Dec 2015 14:32:21 +0100 Subject: [ARC] Add support for atomic memory built-in. gcc/ 2015-12-10 Claudiu Zissulescu * config/arc/arc-protos.h (arc_expand_atomic_op): Prototype. (arc_split_compare_and_swap): Likewise. (arc_expand_compare_and_swap): Likewise. * config/arc/arc.c (arc_init): Check usage atomic option. (arc_pre_atomic_barrier): New function. (arc_post_atomic_barrier): Likewise. (emit_unlikely_jump): Likewise. (arc_expand_compare_and_swap_qh): Likewise. (arc_expand_compare_and_swap): Likewise. (arc_split_compare_and_swap): Likewise. (arc_expand_atomic_op): Likewise. * config/arc/arc.h (TARGET_CPU_CPP_BUILTINS): New C macro. (ASM_SPEC): Enable mlock option when matomic is used. * config/arc/arc.md (UNSPEC_ARC_MEMBAR): Define. (VUNSPEC_ARC_CAS): Likewise. (VUNSPEC_ARC_LL): Likewise. (VUNSPEC_ARC_SC): Likewise. (VUNSPEC_ARC_EX): Likewise. * config/arc/arc.opt (matomic): New option. * config/arc/constraints.md (ATO): New constraint. * config/arc/predicates.md (mem_noofs_operand): New predicate. * doc/invoke.texi: Document -matomic. * config/arc/atomic.md: New file. gcc/testsuite 2015-12-10 Claudiu Zissulescu * lib/target-supports.exp (check_effective_target_arc_atomic): New function. (check_effective_target_sync_int_long): Add checks for ARC atomic feature. (check_effective_target_sync_char_short): Likewise. From-SVN: r231509 --- gcc/config/arc/predicates.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/config/arc/predicates.md') diff --git a/gcc/config/arc/predicates.md b/gcc/config/arc/predicates.md index 43f9474c691..de0735a4071 100644 --- a/gcc/config/arc/predicates.md +++ b/gcc/config/arc/predicates.md @@ -813,3 +813,7 @@ (define_predicate "short_const_int_operand" (and (match_operand 0 "const_int_operand") (match_test "satisfies_constraint_C16 (op)"))) + +(define_predicate "mem_noofs_operand" + (and (match_code "mem") + (match_code "reg" "0"))) -- cgit v1.2.1