4 ms·
Ash HN: question regarding code generation in compilers
I am no compiler writer but I like to read about them a lot. :-)
I have a question to ask which I don't know a better venue than HN. Basically it is
about code generation for AMD64 platform.
For a long time I have been seeing common complains about "inferior" and "poorly designed"
architecture of x86 command system. Most often people would complain about lack
general purpose registers.
When AMD launched their 64-bit extensions (and even Intel with SSE before that) they have
added a lot of that, yet telling GCC, for example, to utilize those capabilities doesn't
make general purpose C programs any faster. Targeting AMD64 vs plain vanilla i386 doesn't
give you hardly and performance boost.
Why?
- yan 17y agoThe lack of performance boost I think is caused for a few reasons: The extreme amount of optimization on both the architecture makers and compiler writers. They hyper-optimized to the architectures they had, so giving them general registers support didn't buy you much. As for why it was lambasted for its lack of general purpose registers? General-purpose registers make writing compiler back-ends cleaner and reduces the need for some stubs.
- ajuc 17y agoAlso, the bottleneck is memory access, not cpu power, so optimising for this or that cpu isn't that important after all.
- wglb 17y agoLonger pointers (64 vs 32) means that programs are bigger and thus are more likely to bust the cache, causing sometimes significant performance hits.