This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/85466] Performance is slow when doing 'branchless' conditional style math operations


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]