Linked by Thom Holwerda on Sun 29th Apr 2012 20:28 UTC
Thread beginning with comment 516280
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
Alright, 64-bit has more registers, though it is rare to find 64-bit-only software--
By simply recompiling the software as 64-bit (assuming it's compiled rather than assembly code) then the compiler will make use of the extra registers when optimizing and thus generate (generally) faster code.
In short, it doesn't have to be written directly for 64-bit, although some of the best improvements between 32-bit and 64-bit I've seen are with hand written assembly. For instance I recall x264 can do something like ~35% faster encodes when using 64-bit while using more demanding presets.
Do system libraries automatically take advantage of those registers?
Depending on what you mean by 'automatically', if they are compiled as 64-bit, then yes. You can do this explicitly by adding -m64 to GCC when compiling.
How much practical difference does this make, however, especially since Haiku is supposedly lightning quick (I haven't used it personally)?
Well os'es are written to be extremely low-latency so optimizations which makes a user-detectable difference are most likely algorithmical rather than the result of compiler optimizations. In short, the OS code will run faster by using these extra registers but you are very unlikely to notice it.
However, when we come to user apps, many of which are not low latency but rely on pure throughput, like compressors, video/audio encoders (like the above mentioned x264), renderers, etc, then the typically ~10-20% improvement in performance with x64 can be a nice boon.
There is one downside to 64bit though, and that is that the code size gets larger (iirc around ~15-20%) which is due to the pointers increasing from 32-bit to 64-bit. This in turn makes 64-bit less efficient performance-wise than it could have been given that the increased code size means it will fill up the cpu caches faster which is also the reason that 32-bit code sometimes (very rarely) can beat equivalent 64-bit code in performance.
There's a new ABI for Linux (x32) which removes this downside by using 32-bit pointers (and thus smaller code) while still using the extended register set in x64 and has shown benchmarks of being ~15% faster than x64-bit code. However using 32-bit pointers means x32 still suffers from the same 4gb addressable ram limit per process like standard 32-bit code does. However if you are fine with your apps only being able to use 4gb (per process, not systemwide) then x32 should be the best of both worlds as far as performance goes.
32-bit has SSE, too, but of course I understand that you mean the subsequent extensions (>=SSSE3). Also, there's NX.
32-bit needs to be built with older systems in mind, ie. those without SSE (any version). On an x86-64 computer, the system can assume these extensions are available (and thus use them in the base system and ABI).





Member since:
2009-03-27
Alright, 64-bit has more registers, though it is rare to find 64-bit-only software--but I also don't know enough to know how this works. Do system libraries automatically take advantage of those registers? I'm guessing GCC -march switches do. How much practical difference does this make, however, especially since Haiku is supposedly lightning quick (I haven't used it personally)?
32-bit has SSE, too, but of course I understand that you mean the subsequent extensions (>= SSSE3). Also, there's NX.
In sum: point taken, though I'm skeptical that it will make a great practical difference anytime soon. OTOH, the psychological impact it will make is probably worth the effort (see comment above). Not to mention that it's not my business! I did GSoC once and would've hated people weighing the value of my efforts ;-)