[PATCH, AArch64 10/11] aarch64: Implement TImode compare-and-swap

2018-09-25 Thread rth7680
From: Richard Henderson This pattern will only be used with the __sync functions, because we do not yet have a bare TImode atomic load. * config/aarch64/aarch64.c (aarch64_gen_compare_reg): Add support for NE comparison of TImode values. (aarch64_print_operand): Ex

[PATCH, AArch64 09/11] aarch64: Implement -matomic-ool

2018-09-25 Thread rth7680
From: Richard Henderson * config/aarch64/aarch64.opt (-matomic-ool): New. * config/aarch64/aarch64.c (aarch64_atomic_ool_func): New. (aarch64_ool_cas_names, aarch64_ool_swp_names): New. (aarch64_ool_ldadd_names, aarch64_ool_ldset_names): New. (aarch64_ool_l

[PATCH, AArch64 11/11] Enable -matomic-ool by default

2018-09-25 Thread rth7680
From: Richard Henderson Do Not Merge Upstream. This is for agraf and his testing within SLES. --- gcc/common/config/aarch64/aarch64-common.c | 6 -- gcc/config/aarch64/aarch64.c | 6 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/common/config/aarch64

[PATCH, AArch64 04/11] aarch64: Improve atomic-op lse generation

2018-09-25 Thread rth7680
From: Richard Henderson Fix constraints; avoid unnecessary split. Drop the use of the atomic_op iterator in favor of the ATOMIC_LDOP iterator; this is simplier and more logical for ldclr aka bic. * config/aarch64/aarch64.c (aarch64_emit_bic): Remove. (aarch64_atomic_ldop_support

[PATCH, AArch64 08/11] aarch64: Add out-of-line functions for LSE atomics

2018-09-25 Thread rth7680
From: Richard Henderson This is the libgcc part of the interface -- providing the functions. Rationale is provided at the top of libgcc/config/aarch64/lse.c. * config/aarch64/lse.c: New file. * config/aarch64/t-lse: New file. * config.host: Add t-lse to all aarch64 tuples

[PATCH, AArch64 07/11] Link static libgcc after shared libgcc for -shared-libgcc

2018-09-25 Thread rth7680
From: Richard Henderson We are about to introduce symbols to libgcc.a that will not be present in libgcc_s.so. Most symbols will be resolved from the shared library first, and only the new symbols will be pulled from the static library. * gcc.c (init_gcc_specs): Include static_name afte

[PATCH, AArch64 06/11] Add visibility to libfunc constructors

2018-09-25 Thread rth7680
From: Richard Henderson * optabs-libfuncs.c (build_libfunc_function_visibility): New, split out from... (build_libfunc_function): ... here. (init_one_libfunc_visibility): New, split out from ... (init_one_libfunc): ... here. --- gcc/optabs-libfuncs.h | 2

[PATCH, AArch64 01/11] aarch64: Simplify LSE cas generation

2018-09-25 Thread rth7680
From: Richard Henderson The cas insn is a single insn, and if expanded properly need not be split after reload. Use the proper inputs for the insn. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Force value into a register for TARGET_LSE; avoid register ov

[PATCH, AArch64 00/11] LSE atomics out-of-line

2018-09-25 Thread rth7680
From: Richard Henderson ARMv8.1 adds an (mandatory) Atomics extension, also known as the Large System Extension. Deploying this extension at the OS level has proved challenging. The following is the result of a conversation between myself, Alex Graf of SuSE, and Ramana Radhakrishnan of ARM, at

[PATCH, AArch64 03/11] aarch64: Improve swp generation

2018-09-25 Thread rth7680
From: Richard Henderson Allow zero as an input; fix constraints; avoid unnecessary split. * config/aarch64/aarch64.c (aarch64_emit_atomic_swap): Remove. (aarch64_gen_atomic_ldop): Don't call it. * config/aarch64/atomics.md (atomic_exchange): Use aarch64_reg_or_zer

[PATCH, AArch64 05/11] aarch64: Emit LSE st instructions

2018-09-25 Thread rth7680
From: Richard Henderson When the result of an operation is not used, we can ignore the result by storing to XZR. For two of the memory models, using XZR with LD has a preferred assembler alias, ST. * config/aarch64/atomics.md (aarch64_atomic__lse): Use ST for relaxed and release

[PATCH, AArch64 02/11] aarch64: Improve cas generation

2018-09-25 Thread rth7680
From: Richard Henderson Do not zero-extend the input to the cas for subword operations; instead, use the appropriate zero-extending compare insns. Correct the predicates and constraints for immediate expected operand. * config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): New.