public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "svfuerst at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/44053] "benchmark" function attribute.
Date: Mon, 10 May 2010 23:27:00 -0000	[thread overview]
Message-ID: <20100510232702.23305.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44053-18995@http.gcc.gnu.org/bugzilla/>



------- Comment #9 from svfuerst at gmail dot com  2010-05-10 23:27 -------
Remember that isnan() is a weird type-dependent macro.  The special case I was
testing is the __float128 version.  __float128's are passed in sse registers,
so using sse instructions to manipulate them can be a win.  (No x87 involved.) 
Unfortunately, the sse instruction set isn't all that orthogonal, so using the
normal 64bit registers can be faster in some cases.  It also isn't obvious
which sse-based algorithm is the best without testing.  Hence all the
benchmarking.

In this case, the resulting function is branchless, so it doesn't matter much
which particular values you use for the input for timings.  However, adding
extra memory reads (like scanning an array for input like you describe), or
writes (via storing the output to a volatile) does change the timings.


-- 


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


      parent reply	other threads:[~2010-05-10 23:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-10  6:27 [Bug middle-end/44053] New: " svfuerst at gmail dot com
2010-05-10  6:36 ` [Bug middle-end/44053] " svfuerst at gmail dot com
2010-05-10  6:55 ` steven at gcc dot gnu dot org
2010-05-10  9:13 ` rguenth at gcc dot gnu dot org
2010-05-10 11:01 ` steven at gcc dot gnu dot org
2010-05-10 14:53 ` svfuerst at gmail dot com
2010-05-10 22:04 ` pinskia at gcc dot gnu dot org
2010-05-10 22:45 ` svfuerst at gmail dot com
2010-05-10 22:50 ` pinskia at gcc dot gnu dot org
2010-05-10 23:27 ` svfuerst at gmail dot com [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=20100510232702.23305.qmail@sourceware.org \
    --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).