3 ms·
Why do you think humans can generate ‘better’ assembly than compilers (aside from some very ‘simple’ cases)? I thought the inverse has been the case for many y
by ffgjgf1 3y ago
Why do you think humans can generate ‘better’ assembly than compilers (aside from some very ‘simple’ cases)?
I thought the inverse has been the case for many years now..
- sylware 3y agoWeird, I will never presume it, only suspect it would. I tend not to be over confident in compilers: what I presume is that compilers inject "convenient bugs" into machine code, which are not in the compiled language but it the end can be exploited. We all know that "software security audits" is about finding "holes" in some machine code, then propagate the fix into the compilers (and often the compiled language). If the machine code does change, the audit must be done all over again. But, where assembly is better: near zero planned obsolescence from compilers (since there are none), which is really a pain on the medium/long run, REALLY! Writting assembly is not really about speed anymore nowdays, it is more about independence from those grotesquely and absurdely massive and complex compilers.
- 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)