/top/
/new/
/best/
/ask/
/show/
/job/
^
slacker news
login
about
←back to thread
The Weird Concept of Branchless Programming
(sanixdk.xyz)
170 points
judicious
| 4 comments |
28 Sep 25 16:40 UTC
|
HN request time: 0.602s
|
source
Show context
Legend2440
◴[
28 Sep 25 18:04 UTC
]
No.
45406467
[source]
▶
>>45405750 (OP)
#
Article doesn’t mention this, but I’d consider neural networks a form of branchless programming. It’s all a bunch of multiply and threshold operations.
replies(2):
>>45406503
#
>>45407289
#
1.
abyesilyurt
◴[
28 Sep 25 18:09 UTC
]
No.
45406503
[source]
▶
>>45406467
#
Thresholding requires branching no?
replies(3):
>>45406688
#
>>45406694
#
>>45407482
#
ID:
GO
2.
WJW
◴[
28 Sep 25 18:32 UTC
]
No.
45406688
[source]
▶
>>45406503 (TP)
#
No, you can do that without branching. See
https://en.algorithmica.org/hpc/pipelining/branchless/#predi...
for example.
3.
Legend2440
◴[
28 Sep 25 18:33 UTC
]
No.
45406694
[source]
▶
>>45406503 (TP)
#
No, it’s just a math operation and can be applied to any amount of data in parallel.
4.
bqmjjx0kac
◴[
28 Sep 25 20:05 UTC
]
No.
45407482
[source]
▶
>>45406503 (TP)
#
As demonstrated in the article, you can compute clamp(x, min, max) with straight-line code.
↑