From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 274E53945C2E for ; Sat, 21 Nov 2020 17:29:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 274E53945C2E Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-373-8I9HujEhMF-jpowSX_dfKQ-1; Sat, 21 Nov 2020 12:29:48 -0500 X-MC-Unique: 8I9HujEhMF-jpowSX_dfKQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 499691DDFE; Sat, 21 Nov 2020 17:29:47 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-152.phx2.redhat.com [10.3.113.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBFBB5C224; Sat, 21 Nov 2020 17:29:46 +0000 (UTC) Subject: Re: [PATCH 28/31] RTL: Add `const_double_zero' syntactic rtx To: "Maciej W. Rozycki" , gcc-patches@gcc.gnu.org Cc: Anders Magnusson , Paul Koning , Matt Thomas References: From: Jeff Law Message-ID: <5c6301b2-80d0-9622-a6d7-d9ae3ddb97ba@redhat.com> Date: Sat, 21 Nov 2020 10:29:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: Sat, 21 Nov 2020 17:29:52 -0000 On 11/19/20 8:36 PM, Maciej W. Rozycki wrote: > The use of a constant double zero is required for post-reload compare > elimination to be able to discard redundant floating-point comparisons, > for example with a VAX RTL instruction stream like: > > (insn 34 4 3 2 (parallel [ > (set (reg/v:DF 0 %r0 [orig:24 x ] [24]) > (mem/c:DF (plus:SI (reg/f:SI 12 %ap) > (const_int 4 [0x4])) [1 x+0 S8 A32])) > (clobber (reg:CC 16 %psl)) > ]) ".../gcc/testsuite/gcc.target/vax/cmpelim-eq-movdf.c":9:1 37 {*movdf} > (nil)) > (note 3 34 35 2 NOTE_INSN_FUNCTION_BEG) > (insn 35 3 36 2 (set (reg:CCZ 16 %psl) > (compare:CCZ (reg/v:DF 0 %r0 [orig:24 x ] [24]) > (const_double:DF 0.0 [0x0.0p+0]))) ".../gcc/testsuite/gcc.target/vax/cmpelim-eq-movdf.c":10:6 21 {*cmpdf_ccz} > (nil)) > (jump_insn 36 35 9 2 (set (pc) > (if_then_else (eq (reg:CCZ 16 %psl) > (const_int 0 [0])) > (label_ref 11) > (pc))) ".../gcc/testsuite/gcc.target/vax/cmpelim-eq-movdf.c":10:6 537 {*branch_ccz} > (int_list:REG_BR_PROB 536870916 (nil)) > -> 11) > > that we want to transform into: > > (insn 34 4 3 2 (parallel [ > (set (reg:CCZ 16 %psl) > (compare:CCZ (mem/c:DF (plus:SI (reg/f:SI 12 %ap) > (const_int 4 [0x4])) [1 x+0 S8 A32]) > (const_double:DF 0.0 [0x0.0p+0]))) > (set (reg/v:DF 0 %r0 [orig:24 x ] [24]) > (mem/c:DF (plus:SI (reg/f:SI 12 %ap) > (const_int 4 [0x4])) [1 x+0 S8 A32])) > ]) ".../gcc/testsuite/gcc.target/vax/cmpelim-eq-movdf.c":9:1 40 {*movdf_ccz} > (nil)) > (note 3 34 36 2 NOTE_INSN_FUNCTION_BEG) > (jump_insn 36 3 9 2 (set (pc) > (if_then_else (eq (reg:CCZ 16 %psl) > (const_int 0 [0])) > (label_ref 11) > (pc))) ".../gcc/testsuite/gcc.target/vax/cmpelim-eq-movdf.c":10:6 537 {*branch_ccz} > (int_list:REG_BR_PROB 536870916 (nil)) > -> 11) > > with the upcoming MODE_CC representation. > > For this we need to express the `const_double:DF 0.0 [0x0.0p+0]' rtx as > recorded above in the relevant pattern(s) in machine description. The > way we represent double constants, as a host-dependent number of wide > integers, however means that we currently have no portable way to encode > a double zero constant in machine description. > > Define a syntactic rtx alias then to represent `(const_double 0 0 ...)' > as if the suitable number of zeros have been supplied according to the > host-specific definition of CONST_DOUBLE_FORMAT. > > gcc/ > * read-rtl.c (rtx_reader::read_rtx_code): Handle syntactic > `const_double_zero' rtx. > * doc/rtl.texi (Constant Expression Types): Document it. OK jeff