From patchwork Tue Jun 6 18:55:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 103188 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1573216qgd; Tue, 6 Jun 2017 11:56:17 -0700 (PDT) X-Received: by 10.84.178.4 with SMTP id y4mr23294594plb.158.1496775377009; Tue, 06 Jun 2017 11:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496775377; cv=none; d=google.com; s=arc-20160816; b=JDPN1hW0PMKsz+a2xeQBKk528LMHkG3GDiY+9FfVRVrr+POIFGWN6XdR8aKQovTEo9 PWjNrmDL7dgqBDi9Bel7PUUIwCH0F6EGIzGuE883+2p2pszv3oJO5+TOBOoIYgIEcUyw VvcEip4dk5CAgDzy0ETtNBk+bhqdDfdced6cZhZquSOdT3VZwYesVXG9uHLdCHA0sjjR yvnRmxDOQH84Y3/BK5FqZQsylOwVbimoymReq2wvGaWn/yiTSYMMKXyO09hDpiN7Uu4w 2HqT4VA/wqnQ7pIElHnzniLaoaFDWaXdfxZixEAyn5biFlsBfUQd386EID6FEddbsKnI EwLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:date:subject:mail-followup-to: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=saOL3ZX7ZoBz85IgDH/8dvfP6uO1ojMYhujqy+NBYx4=; b=RLNIWa1wJKEc8B1+t/OsPBAgwfjredn08EPZCHdE+jI03ObVP6rECrUjveqy9dr4fI QODN5fiSqG+QUgFnyveO//cKmXxq/gLba8wdA68skL1+MBGSTpKPZyN5AyyXkuHGhP8n XPu8+kMq88yvYbAe/65TX3fhOf0n4rmQ8YjEKriGMAT4JKuH4DbgasiJeYInUXZsmRpz fJRwFhhH9Ik/RMjuzpXIpkg7SnVnKsxq9xBXl0njTR4M+bcA2GAOPObeUQredlBV6McJ mYB7VpiUGyHJwD7eUeO4U66XTYmDx+N/9/AvRRBUgAJln0iOJjgQ9eAqVBGPDuibsE7Y EJYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-455275-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-455275-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c75si34180410pfe.281.2017.06.06.11.56.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Jun 2017 11:56:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-455275-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; spf=pass (google.com: domain of gcc-patches-return-455275-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-455275-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com 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:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=SaZGvWKeNujssjSws2XMsh5n5fsZ6N4H/EZUAddepAlQJKYXnj2IZ CAxHeBLaJ5esWwt6zbcBAumrw8Pc3OnWsEcXkECzKR4UO3fOjkdRLtKqLR4XYazn ZCGoObBKT1iJ+Bx/GHXJkPIEtOVIzoKgZkVVGaVIWYQ3OUwy+QXJUU= 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:subject:date:message-id:mime-version:content-type; s= default; bh=Gy8VMJoYigRCXCFn+OB50bf6kv8=; b=XVQ9S6/LiATg/jjJu9qu nVQHmuzenYmgQB2xV58b7Zo+L8QMp2692VuQCB0YZPPO3T+PwnAMPUzSBIowPkp7 1jeov4P9YcYWaxA4EPHyScILnLq/1VKfvuU+FtnnxsClt4aRe1njtzEHp/cp5025 QBe5D7jjZYmoQ1o7rwAGUgE= Received: (qmail 55156 invoked by alias); 6 Jun 2017 18:55:57 -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 55134 invoked by uid 89); 6 Jun 2017 18:55:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=1157 X-HELO: mail-wr0-f172.google.com Received: from mail-wr0-f172.google.com (HELO mail-wr0-f172.google.com) (209.85.128.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Jun 2017 18:55:55 +0000 Received: by mail-wr0-f172.google.com with SMTP id v111so51496760wrc.3 for ; Tue, 06 Jun 2017 11:55:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:date:message-id :user-agent:mime-version; bh=saOL3ZX7ZoBz85IgDH/8dvfP6uO1ojMYhujqy+NBYx4=; b=Eergw70jL/PGPWob/jLx4q4Z4hHUG+fXNtJNMpih1wMgDvPSQDBJ02ak65+DHjP2tY bJu+QElS0QdO8Hh6/zOXDWj38TF2NZwTqpXaTnP3pg+xqpsm+SiNNis0DF7yAYZjzClv W/xSGepdFAaMQiS/CJKASVLv+Fq5l1dfgEI0EhHoysr0RGg7WZZB2mD0OSushCGM4PLh VASwp7hkDkO0BaY9/0F8O9BhVQaQdQQ7SkZ8Ak6JtMsvnQqmOFNW3WjFlV3S+p4uWKMS v4w5lr+Gm7hZ/WRtbNpPdJ0kAw346EAnzrl1VJpEpXWQGrsj64JoM/j39BPwStQ9reHp SN7g== X-Gm-Message-State: AODbwcAMURtnZcuCRUkc+AK4biIxyg2GimOXxAJ+DfiGkwVH4ob5nfHh pKfKvsHSOkR5wi3VP6g= X-Received: by 10.223.166.13 with SMTP id k13mr21405656wrc.197.1496775357246; Tue, 06 Jun 2017 11:55:57 -0700 (PDT) Received: from localhost ([2.26.27.176]) by smtp.googlemail.com with ESMTPSA id l190sm18983863wmb.18.2017.06.06.11.55.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Jun 2017 11:55:56 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: Clarify define_insn documentation Date: Tue, 06 Jun 2017 19:55:54 +0100 Message-ID: <87wp8paqth.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch tries to clarify some of the restrictions on define_insn conditions, and also on the use of "#". OK to install? Richard 2017-06-06 Richard Sandiford gcc/ * doc/md.texi: Clarify the restrictions on a define_insn condition. Say that # requires an associated define_split to exist, and that the define_split must be suitable for use after register allocation. Index: gcc/doc/md.texi =================================================================== --- gcc/doc/md.texi 2017-05-31 10:02:28.617662269 +0100 +++ gcc/doc/md.texi 2017-06-06 19:49:40.453694308 +0100 @@ -115,7 +115,7 @@ A @code{define_insn} is an RTL expressio @enumerate @item -An optional name. The presence of a name indicate that this instruction +An optional name. The presence of a name indicates that this instruction pattern can perform a certain standard job for the RTL-generation pass of the compiler. This pass knows certain names and will use the instruction patterns with those names, if the names are defined @@ -166,9 +166,21 @@ individual insn, and only after the insn recognition template. The insn's operands may be found in the vector @code{operands}. -For an insn where the condition has once matched, it -cannot later be used to control register allocation by excluding -certain register or value combinations. +An instruction condition cannot become more restrictive as compilation +progresses. If the condition accepts a particular RTL instruction at +one stage of compilation, it must continue to accept that instruction +until the final pass. For example, @samp{!reload_completed} and +@samp{can_create_pseudo_p ()} are both invalid instruction conditions, +because they are true during the earlier RTL passes and false during +the later ones. For the same reason, if a condition accepts an +instruction before register allocation, it cannot later try to control +register allocation by excluding certain register or value combinations. + +Although a condition cannot become more restrictive as compilation +progresses, the condition for a nameless pattern @emph{can} become +more permissive. For example, a nameless instruction can require +@samp{reload_completed} to be true, in which case it only matches +after register allocation. @item The @dfn{output template} or @dfn{output statement}: This is either @@ -561,6 +573,11 @@ already defined, then you can simply use instead of writing an output template that emits the multiple assembler instructions. +Note that @code{#} only has an effect while generating assembly code; +it does not affect whether a split occurs earlier. An associated +@code{define_split} must exist and it must be suitable for use after +register allocation. + If the macro @code{ASSEMBLER_DIALECT} is defined, you can use construct of the form @samp{@{option0|option1|option2@}} in the templates. These describe multiple variants of assembler language syntax.