This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/85466] Performance is slow when doing 'branchless' conditional style math operations
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 21 Apr 2018 05:19:30 +0000
- Subject: [Bug libstdc++/85466] Performance is slow when doing 'branchless' conditional style math operations
- Auto-submitted: auto-generated
- References: <bug-85466-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85466
--- Comment #19 from Marc Glisse <glisse at gcc dot gnu.org> ---
For the "ifno" case, llvm turns
(item>.5f)?1.:0.
into (cheating on the syntax, we can't do bit_and on float in C)
((item>.5f)?mask:0.) & 1.
where mask is all one bits, and this uses the SSE comparison instruction that
generates said mask or 0.
llvm is missing the extra trick that the following multiplication can be merged
into this, to do directly & .7f.