From patchwork Mon Jul 9 16:38:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw \(lists\)" X-Patchwork-Id: 141467 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2871622ljj; Mon, 9 Jul 2018 09:39:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfg9+J2P86TDkfYvOL4sjTl1Eq6mCbDF5VeoNT1JFBO9X7IskWCmKlkUZ0k8VnA5YycywIo X-Received: by 2002:a62:8917:: with SMTP id v23-v6mr22241421pfd.127.1531154380877; Mon, 09 Jul 2018 09:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531154380; cv=none; d=google.com; s=arc-20160816; b=FKFHu63xiN89a7pBvDK2dfTS1WPtYzCGQwtSsXx34Bg2cm5fsi5+l11ip3z5fSEvBy xjL7u9QRdr+EbYP4yWFkUkppLBUBGlk5aQmxoEyaQGaR9EmEbjTktpvNO22jMQGyFJQg 1uaES14c0Fvi0gNRScqqFMCtYq+04xXhbUzWFyDJoX2jiCT0svJBBhayVJZqHeeoDl0H ASenYcRCTAnFvPAFEs8Qp10APeXU3ztKwvC+uw8LazlMC9G0YzPIjFfnGJAaRaWluUzY xr2bBfdwx+LyLctGswHVizuwfA40MHY6/OduxPCZjF/awo3B1k8m6v85elPykxm3WEB8 ilgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=m8RvBy1C1FfkZciGh9kBFMLkklyo+EfjWH9/QV02BGM=; b=vt1+xKdLLx65fdMJmRgoLskiXEsV3ZLufO7l8Xav+gJDr57/9PD+RUGRRAB3QPJ37T 2kTx8/mUcl+6ZfE1rnlAjDyEqEalxfRq75nGpOUlCT/XQNICdrOzP36NSvFZ2eUE/b+B EeHWb8CD2lavN4lD2Owl1akS3qAjQAH4/ksa367HGehZUyIe4IyO73NlkH3SOXSeAOqk c+AfEJdytAM8cnP3xoIVgfu+LBFDLhO/a4blB4yYs4O3KwzbP4c2vWanr5EyqytCeXFR /Lgck7fP2nxdg8nxB6qwFvmoE/t2ExEdnooavEZmDlPXpGWky56T8KXqhI2kVmOYzM9H W08g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZjQlS9Sl; spf=pass (google.com: domain of gcc-patches-return-481227-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-481227-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a5-v6si14104047pgd.400.2018.07.09.09.39.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 09:39:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-481227-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=ZjQlS9Sl; spf=pass (google.com: domain of gcc-patches-return-481227-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-481227-patch=linaro.org@gcc.gnu.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:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=xc2ttkBofRi3XrhG HSrrDg5N/yTmkfc3dk0hZTgq1EgiZ4y6cBTUeIrX1Jha02SoYnAeWrUY9f3rw24r ElB5NTKE8/EqsUJ6o+IM+NHQv1AJG5VJyMrINRrHcKzbOgMoTa5uINUWUJlxK275 slkysgKz2SoD7C/58paiYhEFIQQ= 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:in-reply-to:references :mime-version:content-type; s=default; bh=AdI5PGpkQBGUs5pQsM0Q7+ rCcK8=; b=ZjQlS9SlVEySC4ASM/dgQSqOxrYa8ot+FBx1HqnHvrl8+0zOzOaSo3 aLp0wXCDe50KzjXSfkf4ZBPIyGxWdpEQ38QSvpQs75ejjsaRNnKGJlTBT3WUOG2W fDMMtNwGC4gmGUp8asSzgx6VX+Wo8AmyaCTaZWkz/CqcNnyqq66QY= Received: (qmail 89966 invoked by alias); 9 Jul 2018 16:39:16 -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 89860 invoked by uid 89); 9 Jul 2018 16:39:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=multimedia, wireless, Wireless, Multimedia X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Jul 2018 16:39:13 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8E8591684; Mon, 9 Jul 2018 09:39:12 -0700 (PDT) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.206.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C7B463F589; Mon, 9 Jul 2018 09:39:11 -0700 (PDT) From: Richard Earnshaw To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw , richard.earnshaw@arm.com Subject: [PATCH 2/7] Arm - add speculation_barrier pattern Date: Mon, 9 Jul 2018 17:38:14 +0100 Message-Id: <1531154299-28349-3-git-send-email-Richard.Earnshaw@arm.com> In-Reply-To: <1531154299-28349-1-git-send-email-Richard.Earnshaw@arm.com> References: <1531154299-28349-1-git-send-email-Richard.Earnshaw@arm.com> MIME-Version: 1.0 This patch defines a speculation barrier for AArch32. * config/arm/unspecs.md (unspecv): Add VUNSPEC_SPECULATION_BARRIER. * config/arm/arm.md (speculation_barrier): New expand. (speculation_barrier_insn): New pattern. --- gcc/config/arm/arm.md | 21 +++++++++++++++++++++ gcc/config/arm/unspecs.md | 1 + 2 files changed, 22 insertions(+) diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 361a026..ca2a2f5 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -12012,6 +12012,27 @@ (define_insn "" [(set_attr "length" "4") (set_attr "type" "coproc")]) +(define_expand "speculation_barrier" + [(unspec_volatile [(const_int 0)] VUNSPEC_SPECULATION_BARRIER)] + "TARGET_EITHER" + " + /* Don't emit anything for Thumb1 and suppress the warning from the + generic expansion. */ + if (!TARGET_32BIT) + DONE; + " +) + +;; Generate a hard speculation barrier when we have not enabled speculation +;; tracking. +(define_insn "*speculation_barrier_insn" + [(unspec_volatile [(const_int 0)] VUNSPEC_SPECULATION_BARRIER)] + "TARGET_32BIT" + "isb\;dsb\\tsy" + [(set_attr "type" "block") + (set_attr "length" "8")] +) + ;; Vector bits common to IWMMXT and Neon (include "vec-common.md") ;; Load the Intel Wireless Multimedia Extension patterns diff --git a/gcc/config/arm/unspecs.md b/gcc/config/arm/unspecs.md index b05f85e..1941673 100644 --- a/gcc/config/arm/unspecs.md +++ b/gcc/config/arm/unspecs.md @@ -168,6 +168,7 @@ (define_c_enum "unspecv" [ VUNSPEC_MCRR2 ; Represent the coprocessor mcrr2 instruction. VUNSPEC_MRRC ; Represent the coprocessor mrrc instruction. VUNSPEC_MRRC2 ; Represent the coprocessor mrrc2 instruction. + VUNSPEC_SPECULATION_BARRIER ; Represents an unconditional speculation barrier. ]) ;; Enumerators for NEON unspecs.