public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "newbie-02 at gmx dot de" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-113365-4-mJIpF7kSja@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113365-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113365

--- Comment #4 from newbie-02 <newbie-02 at gmx dot de> ---
hello @Andrew Pinski,   

just if I'm allowed to add one more point / question:  

using the testing program, playing with optimization, I get  
the following results for binary64s ( doubles ):  

unoptimized:  
time:     result:                    calculation:  
0.005571; 4.940656458412465442E-324; x2d = nextafter( 1E-323, 0.0 ) 
0.002029; 4.940656458412465442E-324; x2d = ( ( 1E-323 ) - 5E-324 ) 
0.005395; 1.482196937523739633E-323; x2d = nextafter( 1E-323, 1.0 ) 
0.002023; 1.482196937523739633E-323; x2d = ( ( 1E-323 ) + 5E-324 ) 
which points out that addition / subtraction are faster in denormals,  
or assignd at compile time despite x2d is defined volatile.  

optimized ( compiled with -O2 ): I mostly! get understandable results,  
( nextafter similar and ADD / SUB faster reg, compiler cheating?,  
but on some occasions ( ~10% of compile attempts ):  
time:     result:                    calculation:  
0.009311; 4.940656458412465442E-324; x2d = nextafter( 1E-323, 0.0 ) 
0.000420; 4.940656458412465442E-324; x2d = ( ( 1E-323 ) - 5E-324 ) 
0.009668; 1.482196937523739633E-323; x2d = nextafter( 1E-323, 1.0 ) 
0.000423; 1.482196937523739633E-323; x2d = ( ( 1E-323 ) + 5E-324 ) 
which has ** ~doubled execution time for nextafters **.  

Is that something I should worry about? Somthing which could be improved?  
Either here by options or in gcc?

      parent reply	other threads:[~2024-01-15 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 23:38 [Bug c/113365] New: " newbie-02 at gmx dot de
2024-01-12 23:40 ` [Bug target/113365] " pinskia at gcc dot gnu.org
2024-01-12 23:50 ` pinskia at gcc dot gnu.org
2024-01-13  0:11 ` newbie-02 at gmx dot de
2024-01-15 15:22 ` newbie-02 at gmx dot de [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113365-4-mJIpF7kSja@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).