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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AAC963858D1E for ; Thu, 1 Sep 2022 14:13:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AAC963858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662041620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wbS6RXAiA8J2tQKoZslw6FcdUBVt4WeDGm9V9Z6hhew=; b=CkSY9jcRJ6Pldl5Oh1l0JlVFA+WDmm++d81nSfYyv7Ku6smyGrk9JASL/oRWCt/BzrbnM+ gJ2jC+Pt8/mtX3EstDj4s3a1FXlPUmffoQ7jpMpmG3ah6XBnVIN+JTGxwlXWbSiYdvuEY8 fF654D5ynjcxzjZIHkIvAPCE2ELdTJ4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-wMUgg5cJNQOA6pZoE8JJ9w-1; Thu, 01 Sep 2022 10:13:38 -0400 X-MC-Unique: wMUgg5cJNQOA6pZoE8JJ9w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DC654185A7BA for ; Thu, 1 Sep 2022 14:13:37 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.149]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 934B51415137; Thu, 1 Sep 2022 14:13:37 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 281EDUJ82771289 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 1 Sep 2022 16:13:30 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 281EDT1F2771285; Thu, 1 Sep 2022 16:13:29 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [PATCH] Add global REAL_VALUE_TYPE infinities to real.*. Date: Thu, 1 Sep 2022 16:13:24 +0200 Message-Id: <20220901141324.2771267-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: We're starting to abuse the infinity endpoints in the frange code and the associated range operators. Building infinities are rather cheap, and we could even inline them, but I think it's best to just not recalculate them all the time. I see about 20 uses of real_inf in the source code, not including the backends. And I'm about to add more :). OK pending tests? gcc/ChangeLog: * emit-rtl.cc (init_emit_once): Initialize dconstinf and dconstninf. * real.h: Add dconstinf and dconstninf. --- gcc/emit-rtl.cc | 5 +++++ gcc/real.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc index 3929ee08986..f25fb70ab97 100644 --- a/gcc/emit-rtl.cc +++ b/gcc/emit-rtl.cc @@ -107,6 +107,8 @@ REAL_VALUE_TYPE dconst1; REAL_VALUE_TYPE dconst2; REAL_VALUE_TYPE dconstm1; REAL_VALUE_TYPE dconsthalf; +REAL_VALUE_TYPE dconstinf; +REAL_VALUE_TYPE dconstninf; /* Record fixed-point constant 0 and 1. */ FIXED_VALUE_TYPE fconst0[MAX_FCONST0]; @@ -6210,6 +6212,9 @@ init_emit_once (void) dconsthalf = dconst1; SET_REAL_EXP (&dconsthalf, REAL_EXP (&dconsthalf) - 1); + real_inf (&dconstinf); + real_inf (&dconstninf, true); + for (i = 0; i < 3; i++) { const REAL_VALUE_TYPE *const r = diff --git a/gcc/real.h b/gcc/real.h index ec78e8a8932..2f490ef9b72 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -462,6 +462,8 @@ extern REAL_VALUE_TYPE dconst1; extern REAL_VALUE_TYPE dconst2; extern REAL_VALUE_TYPE dconstm1; extern REAL_VALUE_TYPE dconsthalf; +extern REAL_VALUE_TYPE dconstinf; +extern REAL_VALUE_TYPE dconstninf; #define dconst_e() (*dconst_e_ptr ()) #define dconst_third() (*dconst_third_ptr ()) -- 2.37.1 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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AAC963858D1E for ; Thu, 1 Sep 2022 14:13:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AAC963858D1E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-wMUgg5cJNQOA6pZoE8JJ9w-1; Thu, 01 Sep 2022 10:13:38 -0400 X-MC-Unique: wMUgg5cJNQOA6pZoE8JJ9w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DC654185A7BA for ; Thu, 1 Sep 2022 14:13:37 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.149]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 934B51415137; Thu, 1 Sep 2022 14:13:37 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 281EDUJ82771289 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 1 Sep 2022 16:13:30 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 281EDT1F2771285; Thu, 1 Sep 2022 16:13:29 +0200 From: Aldy Hernandez To: GCC patches Subject: [PATCH] Add global REAL_VALUE_TYPE infinities to real.*. Date: Thu, 1 Sep 2022 16:13:24 +0200 Message-ID: <20220901141324.2771267-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 01 Sep 2022 14:13:42 -0000 Message-ID: <20220901141324.ZQundRocgy9nvmQykT31gF42gmPF6BcPfKqBm0itK5w@z> We're starting to abuse the infinity endpoints in the frange code and the associated range operators. Building infinities are rather cheap, and we could even inline them, but I think it's best to just not recalculate them all the time. I see about 20 uses of real_inf in the source code, not including the backends. And I'm about to add more :). OK pending tests? gcc/ChangeLog: * emit-rtl.cc (init_emit_once): Initialize dconstinf and dconstninf. * real.h: Add dconstinf and dconstninf. --- gcc/emit-rtl.cc | 5 +++++ gcc/real.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc index 3929ee08986..f25fb70ab97 100644 --- a/gcc/emit-rtl.cc +++ b/gcc/emit-rtl.cc @@ -107,6 +107,8 @@ REAL_VALUE_TYPE dconst1; REAL_VALUE_TYPE dconst2; REAL_VALUE_TYPE dconstm1; REAL_VALUE_TYPE dconsthalf; +REAL_VALUE_TYPE dconstinf; +REAL_VALUE_TYPE dconstninf; /* Record fixed-point constant 0 and 1. */ FIXED_VALUE_TYPE fconst0[MAX_FCONST0]; @@ -6210,6 +6212,9 @@ init_emit_once (void) dconsthalf = dconst1; SET_REAL_EXP (&dconsthalf, REAL_EXP (&dconsthalf) - 1); + real_inf (&dconstinf); + real_inf (&dconstninf, true); + for (i = 0; i < 3; i++) { const REAL_VALUE_TYPE *const r = diff --git a/gcc/real.h b/gcc/real.h index ec78e8a8932..2f490ef9b72 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -462,6 +462,8 @@ extern REAL_VALUE_TYPE dconst1; extern REAL_VALUE_TYPE dconst2; extern REAL_VALUE_TYPE dconstm1; extern REAL_VALUE_TYPE dconsthalf; +extern REAL_VALUE_TYPE dconstinf; +extern REAL_VALUE_TYPE dconstninf; #define dconst_e() (*dconst_e_ptr ()) #define dconst_third() (*dconst_third_ptr ()) -- 2.37.1