schani/linbin

Conditional move

paulie-g opened this issue · 0 comments

Since the comments on the blog post are closed, I'll say it here:

The standard way to elicit a cmov is the ternary operator. This is vastly preferable to doing inline asm (unless you're doing the whole thing in it) since you're allowing the compiler to reason about scheduling across a wider domain.

With that said, replacing a control dependency with a data dependency in the presence of speculative execution isn't a win as often as one would intuit, especially if your intuition was formed by coding in asm on much earlier microarchs as mine was.

-p