Linked by Tony Bourke on Thu 22nd Jan 2004 21:29 UTC
Benchmarks When running tests, installing operating systems, and compiling software for my Ultra 5, I came to the stunning realization that hey, this system is 64-bit, and all of the operating systems I installed on this Ultra 5 (can) run in 64-bit mode.
Permalink for comment
To read all comments associated with this story, please click here.
Re: when you benefit from 64bit
by Megol on Thu 22nd Jan 2004 23:30 UTC

You are wrong.
Almost all processors that supports floating point support native 64bit even in 32bit implementations (also 80bit for IA32/AMD64).

The reason that OpenSSL (and many other softwares that encrypt/decrypt data) can be faster is because it can use 64bit integer registers to implement the algorithms in fewer steps than with 32bit registers. There are very few algorithms besides encryption that needs 64bit operations therefore very few applications gain as much.
Example (Add two 64bit numbers):

32bit IA32:
add eax, ebx ; add lower half
adc ecx,edx ; add upper half

64bit AMD64:
add rax,rbx ; add whole number

Not only does the 32bit version take two instructions instead of one, the second instruction is dependent on the first so they can not execute in parallel. Another problem is that the 32bit version uses 4 registers to represent the numbers while the 64bit uses only two.
If we do the same thing on a RISC processor (MIPS-like in this example) the 32bit version would be even slower as we don't have hardware support for carry:

32bit MIPS-like:
addu r10,r10,r05 ; add lower half
subu r09,r10,r05 ; r09 is negative if carry was generated
srl r09,r09,31 ; shift MSB to LSB position (r09=1 if carry else 0)
addu r11,r11,r06 ; add upper half
addu r11,r11,r09 ; add "carry"

64bit MIPS-like:
addu r10,r10,r05 ; add whole number

The performance difference is even bigger if we compare 64x64->64bit multiplications that many encryption algorithms need.