From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C276B3858D20; Mon, 15 Jan 2024 15:22:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C276B3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705332174; bh=j3qG+F1AE88f7O3Lnt2oAG5ExdhQI2SCwbM+Fpg3QdE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WcFUYCPIez59IsrMBqlaCwxJUmx7gY6pCvXovZeyt/LekKredI9+pXI1D0rBY3c/0 1o17fhbByH1cXUg25ARvE4kY6KpNvn+qxXsdqfY9iWNbRvgZkFJIf6CmsTA/1Iemyy 8xTzttAnX8pwQIBQ246isYPjD1/EwAy0q6qGvnn0= From: "newbie-02 at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113365] LONG DOUBLE: denormals: assigning a constant: factor 100 slow, Date: Mon, 15 Jan 2024 15:22:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: newbie-02 at gmx dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113365 --- Comment #4 from newbie-02 --- hello @Andrew Pinski,=20=20=20 just if I'm allowed to add one more point / question:=20=20 using the testing program, playing with optimization, I get=20=20 the following results for binary64s ( doubles ):=20=20 unoptimized:=20=20 time: result: calculation:=20=20 0.005571; 4.940656458412465442E-324; x2d =3D nextafter( 1E-323, 0.0 )=20 0.002029; 4.940656458412465442E-324; x2d =3D ( ( 1E-323 ) - 5E-324 )=20 0.005395; 1.482196937523739633E-323; x2d =3D nextafter( 1E-323, 1.0 )=20 0.002023; 1.482196937523739633E-323; x2d =3D ( ( 1E-323 ) + 5E-324 )=20 which points out that addition / subtraction are faster in denormals,=20=20 or assignd at compile time despite x2d is defined volatile.=20=20 optimized ( compiled with -O2 ): I mostly! get understandable results,=20=20 ( nextafter similar and ADD / SUB faster reg, compiler cheating?,=20=20 but on some occasions ( ~10% of compile attempts ):=20=20 time: result: calculation:=20=20 0.009311; 4.940656458412465442E-324; x2d =3D nextafter( 1E-323, 0.0 )=20 0.000420; 4.940656458412465442E-324; x2d =3D ( ( 1E-323 ) - 5E-324 )=20 0.009668; 1.482196937523739633E-323; x2d =3D nextafter( 1E-323, 1.0 )=20 0.000423; 1.482196937523739633E-323; x2d =3D ( ( 1E-323 ) + 5E-324 )=20 which has ** ~doubled execution time for nextafters **.=20=20 Is that something I should worry about? Somthing which could be improved?= =20=20 Either here by options or in gcc?=