From patchwork Wed Sep 18 01:58:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 173931 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1870667ill; Tue, 17 Sep 2019 18:58:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzR7891WJEUHBLpbnBkBXn4ptdYsB0/czlErBr+0ey9akyzYkMU03bjomzyt2Fg+IDZhdLD X-Received: by 2002:a50:d090:: with SMTP id v16mr7955562edd.176.1568771920634; Tue, 17 Sep 2019 18:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568771920; cv=none; d=google.com; s=arc-20160816; b=zXQI3tEdMkfTM9T6C8olrwpA6PDcUfdPRyEgENyg6QnPvwpoF2t5touai7KvtbBd7L 39NRZDBZptxgothPKAo6BYu84tPc0ZxD3Fca+fvo/OYgdB5cp9iEYf6KwC1crsCUP9Rj vwMEeSjq6QB7XvoPpP1nZ9WszCkZ0WEk+gw1ehWfQoxE9E668gJ3x5FRDbzprlGoBTBL qxBZeEJa//Hujk6sZPJ/vb6iArH1MJCccAKrwwKxxZ/xEFCyrJrZUF3XzwODcYjivbTz 2TZmAgPmVpgC1cpB3L0QPG9XyTKbVUEvHlbIMRPtjjJRnDY5A9y5oQVeVzzcr4vgYM1F th/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature:delivered-to :sender:list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=4b2Lc4uZ7yWsHmubu4dWNzMeoD2kWsx6ycjAH3h6jdk=; b=qtLiAUGHJn6LSo9Zxpk/PR3zgefgXnQ6STaw6dIBlrTwikFMDpbQ5Me299u6BDE2Vr 0iEAQVSsYJ+qoLLFuELNIxap9mEyoAp5duAjFRUwA9sovvFjTUq6q3706CCmdd4Aaoi/ 3bpxe4WO4xTZLxVRJfTIkhUpeK9r98KJNVVnKAXx4UNKMGQBI5eLHLavXRsAsbIYjTnk 4I+gEGYsz2GUl4g7s8zSoWSPwrGi7mjnxGpFCquBlS3aPUeuLHwWXGSgz5iXBluWjLS1 DbnNzPHPhBCI2jl6nzUGZSpkYEYZnpaf4HT1JF2Is2hq6M0spOZXV4lfGurcH/O1ygqZ tirw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=d9UCk60r; dkim=pass header.i=@linaro.org header.s=google header.b=FGzKfoQq; spf=pass (google.com: domain of gcc-patches-return-509143-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-509143-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b12si2633957edk.16.2019.09.17.18.58.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Sep 2019 18:58:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-509143-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=d9UCk60r; dkim=pass header.i=@linaro.org header.s=google header.b=FGzKfoQq; spf=pass (google.com: domain of gcc-patches-return-509143-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-509143-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=JJo4Pk4tto2f HYxHCnDGDqZaB5hMR3gzqPtKX5kdt2M8Fu3pw6jQV4gftGMqzptR7u6hPqRUMJcb X4ggaGPfgn6yvt/tBKKGp+M6Ro7gOBKX++V7baANXLF/O/5h3oVxwZGpEn/k2KUI wp0OlLE1vyDc4yJ4jkoQuHA0AozLZcQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=s+1BSrOPdkSoX1tSr6 aVk06Cl5M=; b=d9UCk60rEnoF1aBJ3IWqStHMflrG4w8xq0Rfz6k7PzYsNGEiA4 g7Ahsld1uEy8Zy2PEXTn5s51krxFoVNAM6v5vIIsNvxQidSVcmhRucRGlxs+Wn/U 5zyhBQNmMpPLdpx/h71kK0e7pGEdnxWHN4XzgwnBcYAGRQRXC2VvdhNV4= Received: (qmail 120477 invoked by alias); 18 Sep 2019 01:58:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 120441 invoked by uid 89); 18 Sep 2019 01:58:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:host, sk:swap_co, HX-Languages-Length:2781, UD:opt X-HELO: mail-pf1-f175.google.com Received: from mail-pf1-f175.google.com (HELO mail-pf1-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2019 01:58:22 +0000 Received: by mail-pf1-f175.google.com with SMTP id q7so3300008pfh.8 for ; Tue, 17 Sep 2019 18:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=4b2Lc4uZ7yWsHmubu4dWNzMeoD2kWsx6ycjAH3h6jdk=; b=FGzKfoQq998+Nq7PlNkF+f+WaFbvc0xe3GW5o9oSy5pZMHHnmFtkmOQLSzWwc9v/XJ IE6Le4S12mhr23UG3EN2nZgDdn1Gx3/TZ6nIJZ5Tm7Z1GZlLIZlRAeB/gJVzYRQ3pfrP AER+V+qRYY5sOqItH/qi7HocYV0Q3TIhxGsYU7uwcx/7IFQHZOSxhmDX4OvDKxVyR1zH /mr8hh/s3L1YnIJpKVDroG+ygxzYaq8zi90WZWDibU2vOTtq54Fd99ifLABibE6sFtBE CW1fyPGQHCMI3ArDiesIu5qs1DUml1HllL88aIMttaf+DMw0Yidvjtb1GC6UWKOSRxW6 1Fcg== Return-Path: Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id d10sm6614306pfn.50.2019.09.17.18.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 18:58:19 -0700 (PDT) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: Wilco.Dijkstra@arm.com, kyrylo.tkachov@foss.arm.com, Marcus.Shawcroft@arm.com, James.Greenhalgh@arm.com Subject: [PATCH, AArch64 v4 0/6] LSE atomics out-of-line Date: Tue, 17 Sep 2019 18:58:11 -0700 Message-Id: <20190918015817.24408-1-richard.henderson@linaro.org> Version 3 was back in November: https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00062.html Changes since v3: * Do not swap_commutative_operands_p in aarch64_gen_compare_reg. This is the probable cause of the bootstrap problem that Kyrill reported. * Add unwind markers to the out-of-line functions. * Use uxt{8,16} instead of mov in CAS functions, in preference to including the uxt with the cmp. * Prefer the lse case in the out-of-line fallthru (Wilco). * Name the option -moutline-atomics (Wilco) * Name the variable __aarch64_have_lse_atomics (Wilco); fix the definition in lse-init.c. * Rename the functions s/__aa64/__aarch64/ (Seemed sensible to match prev) * Always use Pmode for the address for libcalls, fixing ilp32 (Kyrill). Still not done is a custom calling convention during code generation, but that can come later as an optimization. Tested aarch64-linux on a thunder x1. I have not run tests on any platform supporting LSE, even qemu. r~ Richard Henderson (6): aarch64: Extend %R for integer registers aarch64: Implement TImode compare-and-swap aarch64: Tidy aarch64_split_compare_and_swap aarch64: Add out-of-line functions for LSE atomics aarch64: Implement -moutline-atomics TESTING: Enable -moutline-atomics by default gcc/config/aarch64/aarch64-protos.h | 13 + gcc/common/config/aarch64/aarch64-common.c | 6 +- gcc/config/aarch64/aarch64.c | 204 +++++++++++---- .../atomic-comp-swap-release-acquire.c | 2 +- .../gcc.target/aarch64/atomic-op-acq_rel.c | 2 +- .../gcc.target/aarch64/atomic-op-acquire.c | 2 +- .../gcc.target/aarch64/atomic-op-char.c | 2 +- .../gcc.target/aarch64/atomic-op-consume.c | 2 +- .../gcc.target/aarch64/atomic-op-imm.c | 2 +- .../gcc.target/aarch64/atomic-op-int.c | 2 +- .../gcc.target/aarch64/atomic-op-long.c | 2 +- .../gcc.target/aarch64/atomic-op-relaxed.c | 2 +- .../gcc.target/aarch64/atomic-op-release.c | 2 +- .../gcc.target/aarch64/atomic-op-seq_cst.c | 2 +- .../gcc.target/aarch64/atomic-op-short.c | 2 +- .../aarch64/atomic_cmp_exchange_zero_reg_1.c | 2 +- .../atomic_cmp_exchange_zero_strong_1.c | 2 +- .../gcc.target/aarch64/sync-comp-swap.c | 2 +- .../gcc.target/aarch64/sync-op-acquire.c | 2 +- .../gcc.target/aarch64/sync-op-full.c | 2 +- libgcc/config/aarch64/lse-init.c | 45 ++++ gcc/config/aarch64/aarch64.opt | 3 + gcc/config/aarch64/atomics.md | 187 +++++++++++++- gcc/config/aarch64/iterators.md | 3 + gcc/doc/invoke.texi | 16 +- libgcc/config.host | 4 + libgcc/config/aarch64/lse.S | 235 ++++++++++++++++++ libgcc/config/aarch64/t-lse | 44 ++++ 28 files changed, 709 insertions(+), 85 deletions(-) create mode 100644 libgcc/config/aarch64/lse-init.c create mode 100644 libgcc/config/aarch64/lse.S create mode 100644 libgcc/config/aarch64/t-lse -- 2.17.1