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 CDD423858D33 for ; Thu, 2 Mar 2023 10:32:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CDD423858D33 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=1677753177; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=RpUYGqyFV+ahH+DktiIQ7UlXvhJfogPxdSpfiq/XOTc=; b=OKTWx+N6cLKIaf60d7wsY/zxPwCbOrf/bkaDYdRqx2qBkb3MOx/LT2As6WbCJEPEu9ypsl k0iygXOufG5W8lLEjSUrw2Nd5rhqCmpuR7Y9rYd6DhbzStS3cG4k+L54xZeKnpaHhWKjkw IuJydBt2cfnbx9J1rQDs2wkZnt/09iE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-357-oJcmTaSpO1aOU178tIgMdg-1; Thu, 02 Mar 2023 05:32:52 -0500 X-MC-Unique: oJcmTaSpO1aOU178tIgMdg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D00941C05EA8; Thu, 2 Mar 2023 10:32:51 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 916EF492C14; Thu, 2 Mar 2023 10:32:51 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 322AWjYC3819298 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 2 Mar 2023 11:32:45 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 322AWiNp3819297; Thu, 2 Mar 2023 11:32:44 +0100 Date: Thu, 2 Mar 2023 11:32:44 +0100 From: Jakub Jelinek To: Gerald Pfeifer , Martin =?utf-8?B?TGnFoWth?= Cc: gcc-patches@gcc.gnu.org Subject: [wwwdocs] gcc-13/porting_to.html: Document C++ -fexcess-precision=standard Message-ID: Reply-To: Jakub Jelinek References: <541d2859-4029-3a21-e57e-10a401c5d226@pfeifer.com> MIME-Version: 1.0 In-Reply-To: <541d2859-4029-3a21-e57e-10a401c5d226@pfeifer.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-9.7 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_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: 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: 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