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 9A93F3857C7D for ; Tue, 25 Aug 2020 11:10:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9A93F3857C7D 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-25-WIwvpGkFNiSQXGyH08AR2Q-1; Tue, 25 Aug 2020 07:10:12 -0400 X-MC-Unique: WIwvpGkFNiSQXGyH08AR2Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9434081F01D for ; Tue, 25 Aug 2020 11:10:11 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-113-99.ams2.redhat.com [10.36.113.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6660160DA0 for ; Tue, 25 Aug 2020 11:10:11 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id A0681A83A73; Tue, 25 Aug 2020 13:10:09 +0200 (CEST) Date: Tue, 25 Aug 2020 13:10:09 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH 1/2] Avoid implicit floating point conversions [v2] Message-ID: <20200825111009.GI3272@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20200821003539.942952-1-keithp@keithp.com> <20200821003539.942952-2-keithp@keithp.com> <20200824095821.GA3272@calimero.vinschen.de> <87r1rwf47t.fsf@keithp.com> MIME-Version: 1.0 In-Reply-To: <87r1rwf47t.fsf@keithp.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, 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: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 11:10:15 -0000 On Aug 24 08:33, Keith Packard via Newlib wrote: > Corinna Vinschen via Newlib writes: > > > Not taking implicit compiler optimisations into account, wouldn't it > > make more sense to avoid the conversion altogether, using > > __builtin_inf() in these places? > > Yeah, could do that instead. I think it's mostly a matter of what looks > better -- using the "standard" value of INFINITY and casting or using a > compiler internal value without. I think it'll confuse an equal number > of people either way. > > Any preferences? __builtin_inf(), or a sufficiently expressive macro. It's pretty unfortunate that POSIX defines INFINITY and NAN as float, rather than providing type-matching macros as in HUGE_VALF - HUGE_VAL - HUGE_VALL. Something like #define _INF (__builtin_inf()) comes to mind. Corinna