72
How often does branchless programming actually matter?
(programming.dev)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
It's useful in digital signal processing, but otherwise it just makes your code harder to read.
Usually compilers will optimize the second one to a
cmov
or similar instruction, which is as close to fast branching as it can (exceptcfmov
on older x86 CPUs), and is DSP compatible.