Thought this might interest people here.
"If you came for readable code, sorry, branchless programming is
basically code golf with caffeine ...
"By rewriting conditional logic into arithmetic and bit operations, or
using CPU instructions like cmov, we let the CPU chew through code
without pausing to guess. It?s smoother, faster, and often more deterministic, which is crucial in performance-critical or side-channel-resistant scenarios (looking at you, cryptography)."
https://sanixdk.xyz/blogs/the-weird-concept-of-branchless-programming
HN discussion:
https://news.ycombinator.com/item?id=45405750
Alexis.
"By rewriting conditional logic into arithmetic and bit operations, or
using CPU instructions like cmov, we let the CPU chew through code
without pausing to guess. It?s smoother, faster, and often more deterministic, which is crucial in performance-critical or side-channel-resistant scenarios (looking at you, cryptography)."
On Thu, 16 Oct 2025 20:13:48 +1100, Alexis wrote:more
"By rewriting conditional logic into arithmetic and bit operations,
or using CPU instructions like cmov, we let the CPU chew through
code without pausing to guess. It?s smoother, faster, and often
deterministic, which is crucial in performance-critical or side-channel-resistant scenarios (looking at you, cryptography)."
The original 32-bit ARM architecture (you know, the most popular CPU architecture in the world) had extra bits in the opcode to allow
(nearly?) every instruction to be executed conditionally, without
explicit branching.
They gave up on this idea in the 64-bit version of ARM.
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 14 |
Nodes: | 8 (0 / 8) |
Uptime: | 46:05:53 |
Calls: | 178 |
Files: | 21,502 |
Messages: | 79,006 |