public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Who cares about performance (or Intel's CPU errata)?
@ 2023-05-27 21:20 Stefan Kanthak
  2023-05-27 21:47 ` Andrew Pinski
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Kanthak @ 2023-05-27 21:20 UTC (permalink / raw)
  To: gcc

Just to show how SLOPPY, INCONSEQUENTIAL and INCOMPETENT GCC's developers are:

--- dontcare.c ---
int ispowerof2(unsigned __int128 argument) {
    return __builtin_popcountll(argument) + __builtin_popcountll(argument >> 64) == 1;
}
--- EOF ---

GCC 13.3    gcc -march=haswell -O3

https://gcc.godbolt.org/z/PPzYsPzMc
ispowerof2(unsigned __int128):
        popcnt  rdi, rdi
        popcnt  rsi, rsi
        add     esi, edi
        xor     eax, eax
        cmp     esi, 1
        sete    al
        ret

OOPS: what about Intel's CPU errata regarding the false dependency on POPCNTs output?

See https://gcc.godbolt.org/z/jdjTc3EET for comparison!

FIX YOUR BUGS, KIDS!

Stefan

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

end of thread, other threads:[~2023-05-29 18:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-27 21:20 Who cares about performance (or Intel's CPU errata)? Stefan Kanthak
2023-05-27 21:47 ` Andrew Pinski
2023-05-27 22:52   ` Stefan Kanthak
2023-05-27 23:18     ` Mark Wielaard
2023-05-27 23:30     ` Andrew Pinski
2023-05-28  7:47       ` Stefan Kanthak
2023-05-28 12:29       ` David Brown
2023-05-29 18:11       ` Who cares about size? (was: Who cares about performance (or Intel's CPU errata)?) Stefan Kanthak
2023-05-28  6:40     ` Who cares about performance (or Intel's CPU errata)? Nicholas Vinson

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