Re:Unexpected Ways Memory Subsystem Interacts with Branch Pr...
by gpderetta on Friday December 29, 2023 @05:27PM
(#38810990)
SETcc is indeed what GCC typically uses. You can also play tricks with the carry flag and ADC but I don't think I have ever seen GCC do it.
The x86 family has the `setCC` instructions [^1] that move bits from the flag register to a general purpose one. Example from godbolt, see `setg`:
https://c.godbolt.org/z/MY37oP9vz
[^1]: https://www.felixcloutier.com/x86/setcc