From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id D5E7F386FC05 for ; Thu, 3 Jun 2021 19:32:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D5E7F386FC05 Received: by mail-pf1-x436.google.com with SMTP id q25so5676542pfh.7 for ; Thu, 03 Jun 2021 12:32:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=P+a7kgHdy9WJKR4eqNohw5TByaSWjV8C/9SVxZb0a5M=; b=rH2Tu7xCVznoqdbInmt8CW6OsmscZ6dSirwGYq4P5ExHb8qIT0Tir5kCF28IQ6jD6t zavlweE1Br29jzFJDh83l4/e2DiR0ykqs/+tqKcz2yB/B1MRcuV3MEIhEk7Y4TbTjZ0q bl74ESnSF2GwlcVP4yhp3+FH/leiX5YbC7rwjaDWIa4dr8rzccYp2M5QFBII6YpmhlLI 1H06pDpBnK/e9u+e+gMmmrY9BZHUd59zCarwMNvB3eNpxg1W6SodoxC6tqbbAdF3Ypu5 AS7DHCs+LAWqfhj812Dy8i0QEJRD7c76Ttu7TMCb6GiLOXA4LQcKUdR3jnQuy6cBvrHc BFpA== X-Gm-Message-State: AOAM530AXgZQIr2dfuTjO6BPZerLm6BJialrRZJdm6p61lHgc9EvIpvz mZCPi1anSai5q8FXo7eed20= X-Google-Smtp-Source: ABdhPJxO0pIeeHjF8gHhTpJuK420EtNF1/yAGH8cSwJv2N9K6yA4rT0nX8Hc2B+tM/hHaHF84KfzhQ== X-Received: by 2002:a63:3e84:: with SMTP id l126mr1087025pga.70.1622748776864; Thu, 03 Jun 2021 12:32:56 -0700 (PDT) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id e2sm2910592pfc.135.2021.06.03.12.32.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 12:32:56 -0700 (PDT) Subject: Re: [PATCH] rtl: constm64_rtx..const64_rtx To: Segher Boessenkool , gcc-patches@gcc.gnu.org, richard.sandiford@arm.com References: <20210602224359.GL18427@gate.crashing.org> From: Jeff Law Message-ID: Date: Thu, 3 Jun 2021 13:32:54 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210602224359.GL18427@gate.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 19:33:00 -0000 On 6/2/2021 4:43 PM, Segher Boessenkool wrote: > Hi! > > On Wed, Jun 02, 2021 at 06:07:28PM +0100, Richard Sandiford wrote: >> Segher Boessenkool writes: >>> Since times immemorial there has been const_int_rtx for all values from >>> -64 to 64, but only constm1_rtx..const2_rtx have been available for >>> convenient use. Change this, so that we can use all values in >>> {-64,...,64} in RTL easily. This matters, because then we we just say >>> if (XEXP (x, 1) == const16_rtx) >>> and things like that, since all const_int in that range are unique. We >>> already do for -1, 0, 1, 2, but we could for everything. >> No strong objection, but personally I'd rather not add something >> that is very specific to VOIDmode CONST_INTs. I realise it's very >> unlikely that we'll ever be able to give CONST_INTs their proper mode >> (no-one has the kind of time needed to do that), but I don't think we >> should make the switch actively harder either. > How does this make that harder? > > Having no mode for CONST_INTs makes some things significantly *easier* > btw. Well you know that, that is what makes any conversion away from > this so much harder :-) > > We have has const0_rtx etc. since forever, this patch just increases the > range (to those values that have had guaranteed unique RTXes since > decades as well). Yea, but often what you really want is CONST0_RTX (mode) instead of const0_rtx.   It's easily goof'd and often the cause minor missed optimizations. jeff