3 ms·
> Why do you think humans can generate ‘better’ assembly than compilers (aside from some very ‘simple’ cases)? I think that compilers + human supervision resul
by camel-cdr 3y ago
> Why do you think humans can generate ‘better’ assembly than compilers (aside from some very ‘simple’ cases)?
I think that compilers + human supervision results on the best assembly code gen.
Compilers are great at vectorization, but they can fail at very trivial examples, e.g.:
typedef struct { char a, b; } S;
void zeroB(S *s, size_t n) {
for (; --n; ++s) s->b = 0;
}
- sylware 3y agohttps://godbolt.org/noscript https://godbolt.org/noscript Since I am more and more comfy at writing assembly, it is usually kind of less of a pain to write directly assembly than to refactor and comment compiler assembly output.
- camel-cdr 3y agoYou botched the link. (I had the same problem btw, otherwise I would've included a godbolt link as well, but idk how to create one with noscript)