Get the latest tech news

The Weird Concept of Branchless Programming


2025-07-08 01:37 • 19+ min read • #c #branchless -O3 -ffast-math -march=native -fomit-this-entire-function) were taken. Modern CPUs are predictive creatures.

But if it's unpredictable, say, random data or user input, then the CPU may guess wrong, flush its pipeline, and pay a heavy penalty. Imagine a tight loop that checks a condition based on data from user input, or real-world sensors, or shuffled arrays. abs(x), a gentle warm-up with unary fun clamp(x, min, max), a common pattern with two conditions partition(), a full algorithm with data-dependent control flow

Get the Android app

Or read this on Hacker News

Read more on:

Photo of weird concept

weird concept