←back to thread

386 points ingve | 1 comments | | HN request time: 0.422s | source
Show context
SleepyMyroslav ◴[] No.35738552[source]
If being branchless is important property of the algorithm then it is better to enforce it. Or at least test for it. If his GCC version will get an update and it will stop producing assembly that he wants no-one will ever know.

Which brings us back to regular discussion: C ( and C++ ) does not match hardware anymore. There is no real control over important properties of generated code. Programmers need tools to control what they write. Plug and pray compilation is not a solid engineering approach.

replies(6): >>35738629 #>>35738633 #>>35738677 #>>35738943 #>>35741009 #>>35745436 #
pjmlp ◴[] No.35738633[source]
The myth that they match has been busted since at very least Pentium came to be.

A good read of Michael Abrash books explains that quite well, as does playing around Intel's VTune.

replies(2): >>35738709 #>>35738794 #
SleepyMyroslav ◴[] No.35738794[source]
If that myth has been busted 20 years ago when I have started working close in time with Pentiums then HN crowd never got the memo.

Even right now i have two replies above yours that completely ignore the point of discussed article. Which is that algorithm is 'branchless'.

PS. I agree with comment in this topic from 'mgaunard' that algorithm should have been written as branchless explicitly.

replies(1): >>35738885 #
1. pjmlp ◴[] No.35738885[source]
HN crowd has never got the memo in many subjects, another one is how the game development culture differs from FOSS.