From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id B4EDB3858D33 for ; Thu, 2 Mar 2023 12:40:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B4EDB3858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B8B351FE6B; Thu, 2 Mar 2023 12:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1677760815; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ufxkl3XPafaYZFZgoI5t1ocx0c29aNFw+lhWGcqaVV0=; b=Lm7+lQmctbn1TWhHOLDqu5rPpiJRKS/WYvFkEWBrgolBIDwlH6R4n1vaG+Jk2OjXsgiAp/ 7UQlo179yW2xhLKGf5XkH8KBI0GG2bl2Kx7Y5AV/FClFjPVggjiukOkJ5AAztS22LHH11n tEK2ETlUd+RDsipwCJxOAlMIOSOYP58= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1677760815; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ufxkl3XPafaYZFZgoI5t1ocx0c29aNFw+lhWGcqaVV0=; b=4EgN2oQ+yhF4GPFIY6ACy4dGe+36y7Ip0ts7/xS4bYVEmhTJDYcjx5y8WW9HKpAm8Dl8ex rW0GSL25bCG8GLAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A15F113349; Thu, 2 Mar 2023 12:40:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Js5GJi+ZAGQxJwAAMHmgww (envelope-from ); Thu, 02 Mar 2023 12:40:15 +0000 Message-ID: <5a1cc7c0-53a6-9b1d-5bdf-f9452d55aa98@suse.cz> Date: Thu, 2 Mar 2023 13:40:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [wwwdocs] gcc-13/porting_to.html: Document C++ -fexcess-precision=standard Content-Language: en-US To: Jakub Jelinek , Gerald Pfeifer Cc: gcc-patches@gcc.gnu.org References: <541d2859-4029-3a21-e57e-10a401c5d226@pfeifer.com> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_NONE,SPF_SOFTFAIL,TXREP 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: On 3/2/23 11:32, Jakub Jelinek wrote: > Hi! > > On Fri, Feb 10, 2023 at 10:06:03AM +0100, Gerald Pfeifer wrote: >> Yes, thank you! Two minor suggestions/questions below: >> >>> --- a/htdocs/gcc-13/changes.html >>> +++ b/htdocs/gcc-13/changes.html >>> + -fexcess-precision=fast. The option affects mainly >> >> Here I'd say "mainly affects". >> >>> + IA-32/x86-64 where when defaulting to x87 math and in some cases on >>> + Motorola 68000 float and double expressions >>> + are evaluated in long double precision and S/390, System z, >>> + IBM z Systems where float expressions are evaluated in >>> + double precision. >> >> The "where when" part proved a bit tricky for my brain. :-) >> >> I think it is precise, but am wondering whether >> >> ...IA-32/x64 using x87 math and in some cases on Motorola 68000, where >> float and double expressions are evaluated... >> >> might work? What do you think? > > Thanks, committed with those tweaks. > > Martin would like to see some note in porting_to.html for it too, > here is my attempt to do so: I like the suggested wording. Thanks for it. Martin > > diff --git a/htdocs/gcc-13/porting_to.html b/htdocs/gcc-13/porting_to.html > index 9a9a3147..5cbeefb6 100644 > --- a/htdocs/gcc-13/porting_to.html > +++ b/htdocs/gcc-13/porting_to.html > @@ -120,5 +120,29 @@ the operand as an lvalue.
> } > > > +

Excess precision changes

> +

GCC 13 implements in C++ excess precision support > +which has been implemented just in the C front-end before. The new behavior is > +enabled by default in -std=c++NN modes and when > +FLT_EVAL_METHOD is 1 or 2 affects behavior of floating point > +constants and expressions. E.g. for FLT_EVAL_METHOD equal > +to 2 on ia32: > + > +


> +#include 
> +void foo (void) { if (1.1f + 3.3f != 1.1L + 3.3L) abort (); }
> +void bar (void) { double d = 4.2; if (d == 4.2) abort (); }
> +
> + > +will not abort with standard excess precision, because constants and expressions > +in float or double are evaluated in precision of > +long double and demoted only on casts or assignments, but will > +abort with fast excess precision, where whether something is evaluated in > +precision of long double or not depends on what evaluations are > +done in the i387 floating point stack or are spilled from it. > + > +The -fexcess-precision=fast option can be used to request the > +previous behavior. > + > > > > > Jakub >