public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jchthys at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/49148] Certain expressions take an extremely long time for no apparent reason
Date: Wed, 25 May 2011 14:45:00 -0000	[thread overview]
Message-ID: <bug-49148-4-91yuXLuZuS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49148-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49148

--- Comment #7 from John Peyton <jchthys at yahoo dot com> 2011-05-25 14:40:56 UTC ---
> Try -ffast-math (the default for ICC) which disables subnormals.

Thanks, this helped it run much faster!

I noticed it still takes longer to divide by 3.0 than by 4.0. More
specifically, the following line was fast:

     new[i] = (A[i-1] + 2*A[i] + A[i+1]) / 4.0;

The following line took about 4 times as long to run without -ffast-math:

     new[i] = (A[i-1] + A[i] + A[i+1]) / 3.0;

With -ffast-math, it was faster; however, it was still took about 2 times as
long as the division by 4.0 version. In addition, changing division by 3.0 to
multiplication by 0.333 or even 0.3 did not affect the speed.

Could this also be related to subnormal numbers, or is this just a different
issue?


  parent reply	other threads:[~2011-05-25 14:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 19:14 [Bug c/49148] New: " jchthys at yahoo dot com
2011-05-24 19:16 ` [Bug c/49148] " jchthys at yahoo dot com
2011-05-24 19:41 ` jchthys at yahoo dot com
2011-05-24 20:06 ` jchthys at yahoo dot com
2011-05-24 20:42 ` pinskia at gcc dot gnu.org
2011-05-24 21:47 ` [Bug rtl-optimization/49148] " jchthys at yahoo dot com
2011-05-24 21:55 ` jchthys at yahoo dot com
2011-05-25  9:56 ` rguenth at gcc dot gnu.org
2011-05-25 14:45 ` jchthys at yahoo dot com [this message]
2021-12-26 12:49 ` pinskia at gcc dot gnu.org

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-49148-4-91yuXLuZuS@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).