Branchless Programming: Difference between revisions

Line 68: Line 68:
you can just write <code>x += age>10</code>.
you can just write <code>x += age>10</code>.


These are micro optimizations but they are sometimes useful for speeding up GPU shaders.
These are micro optimizations but they could be useful for speeding up GPU shaders in some cases.


==Resources==
==Resources==
* [https://francescocirillo.com/pages/anti-if-campaign Anti If Campaign]
* [https://francescocirillo.com/pages/anti-if-campaign Anti If Campaign]
* [https://code.joejag.com/2016/anti-if-the-missing-patterns.html Anti-If: The missing pattersn]
* [https://code.joejag.com/2016/anti-if-the-missing-patterns.html Anti-If: The missing pattersn]