[Bug middle-end/98801] Request for a conditional move built-in function

jeffhurchalla at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 26 00:17:09 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98801

--- Comment #6 from Jeff Hurchalla <jeffhurchalla at gmail dot com> ---
I'd be quite satisfied with the simpler option that Peter Cordes wrote:

> a non-memory conditional-select builtin that exposes the much more widely
> available ALU conditional-select functionality like x86 CMOV, AArch64 CSEL,
> MIPS MVN, etc.
...
> The ALU-select part can be emulated with AND/OR, so that's something we can
> provide on any target.

A predicated reg-reg move like this is appealing to me for my needs.  It seems
common in ISAs and emulatable when not present.

I perceive that the security use-case for cmovs could be more important than my
motivation for them (my motivation: performance in critical loops containing
unpredictable conditionals).  I suspect the guarantees needed for security
would satisfy me despite having a different motivation.


More information about the Gcc-bugs mailing list