Linked by Thom Holwerda on Sun 29th Apr 2012 20:28 UTC
BeOS & Derivatives "During the coding period, I will first work on the boot loader. I intend to modify the existing x86 boot loader so that it is capable of loading both a 32-bit Haiku kernel and a 64-bit one. Once this is done, I will work on implementing the x86_64 architecture functionality in the kernel. Finally, I will port modules and drivers to the 64-bit kernel. Should I have time, I will also begin work on porting userland." Heck. Yes.
Thread beginning with comment 516280
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: Cool, but...
by earksiinni on Mon 30th Apr 2012 04:53 UTC in reply to "RE: Cool, but..."
earksiinni
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 ;-)

Reply Parent Score: 2

RE[3]: Cool, but...
by Valhalla on Mon 30th Apr 2012 06:01 in reply to "RE[2]: Cool, but..."
Valhalla Member since:
2006-01-24

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.

Reply Parent Score: 3

RE[3]: Cool, but...
by pgeorgi on Mon 30th Apr 2012 06:13 in reply to "RE[2]: Cool, but..."
pgeorgi Member since:
2010-02-18

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).

Reply Parent Score: 1

RE[4]: Cool, but...
by tidux on Mon 30th Apr 2012 12:46 in reply to "RE[3]: Cool, but..."
tidux Member since:
2011-08-13

This is especially true on Haiku, since it's compiled for i586, which means but it'll run on a Pentium Pro, but precludes using SSE2 or later in binaries.

Reply Parent Score: 1