In fairness, I have the same question
-
-
Replying to @myrrlyn
I mean I feel like “for shits and giggles” is a decent answer.
3 replies 2 retweets 10 likes -
Replying to @pasiphae_goals @myrrlyn
That or "because compilers are a #%#@!@#$ing trainwreck at times."
1 reply 0 retweets 1 like -
Replying to @stephentyrone @pasiphae_goals
I mean, yes. I can think of almost nothing that would warrant hand-rolled ASM but maybe I'm blinkered
1 reply 0 retweets 1 like -
Replying to @myrrlyn @pasiphae_goals
Compilers generate perfectly adequate code for most programs. For compute-bound sections with non-trivial data access patterns or dependencies, humans are still much, much better.
2 replies 0 retweets 5 likes -
Also, perversely, there are some things that are *really* awkward to write in C-ish langs without invoking UB, but trivial in asm.
1 reply 1 retweet 8 likes -
rotl
2 replies 0 retweets 3 likes -
Yup. A few of the many others: - Saturating convert float -> int. - Aligned load/store that accesses outside the edge of a buffer (but, because aligned, is safe on the targeted arch). - Popcount / CLZ / CTZ (ok, these have gcc builtins). ...
3 replies 0 retweets 8 likes -
Replying to @stephentyrone @johnregehr and
Reportedly LLVM pattern-recognizes de Bruijn approach to ctz & generates the insn portably.
2 replies 0 retweets 3 likes -
Replying to @RichFelker @johnregehr and
That’s strictly worse than a builtin for my purposes: silent perf hazard if someone uses a compiler that doesn’t pattern match.
1 reply 0 retweets 1 like
It's actually pretty much the same speed, just larger size.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.