From: "Stefan Kanthak" <stefan.kanthak@nexgo.de>
To: <gcc@gnu.org>
Subject: Who cares about performance (or Intel's CPU errata)?
Date: Sat, 27 May 2023 23:20:20 +0200 [thread overview]
Message-ID: <23A490318B7149D88618A7CDA2CEDB14@H270> (raw)
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
next reply other threads:[~2023-05-27 21:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-27 21:20 Stefan Kanthak [this message]
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
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=23A490318B7149D88618A7CDA2CEDB14@H270 \
--to=stefan.kanthak@nexgo.de \
--cc=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).