public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/56944] New: Better isfinite in some cases?
@ 2013-04-13  9:24 glisse at gcc dot gnu.org
  2013-04-14 10:21 ` [Bug target/56944] " glisse at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-04-13  9:24 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56944
           Summary: Better isfinite in some cases?
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: glisse@gcc.gnu.org
            Target: x86_64-linux-gnu


Hello,

for isfinite, gcc typically generates this sequence:

    movsd    .LC0(%rip), %xmm1
    andpd    %xmm1, %xmm0
    movsd    .LC1(%rip), %xmm1
    ucomisd    %xmm0, %xmm1
    setae    %al

With -fno-trapping-math, I tried this shorter sequence instead, which should be
valid:

    subsd    %xmm0, %xmm0
    ucomisd    %xmm0, %xmm0
    setnp    %al

Depending on the tests, it seemed to be either the same speed or 15% faster,
whether the argument is normal, infinite or nan. For a denormal argument, it is
15% slower (but then both codes take 100 times as long as the normal case). The
results might also be different on a more recent processor.

I don't know if we want to try and generate this code when -fno-trapping-math
is present.

(related to PR 30652)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-04-19 15:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-13  9:24 [Bug target/56944] New: Better isfinite in some cases? glisse at gcc dot gnu.org
2013-04-14 10:21 ` [Bug target/56944] " glisse at gcc dot gnu.org
2013-04-15 10:26 ` rguenth at gcc dot gnu.org
2013-04-18 22:47 ` glisse at gcc dot gnu.org
2013-04-19  9:53 ` glisse at gcc dot gnu.org
2013-04-19 13:43 ` jakub at gcc dot gnu.org
2013-04-19 15:12 ` glisse at gcc dot gnu.org

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).