Why is the 64bit version normally faster than the 32 bit?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Greyguy
Posts: 14
Joined: Tue Feb 05, 2019 5:03 pm
Full name: Per Hesselgren

Why is the 64bit version normally faster than the 32 bit?

Post by Greyguy »

If we look at KNodes/sec for SF7 it could be like 178 vs 138 (64bit vs 32bit).
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Why is the 64bit version normally faster than the 32 bit?

Post by Michael Sherwin »

Because a 64 bit processor has 64 bit and 32 bit registers and can execute code written for either 64 bit processors or code written for 32 bit processors. A bitboard engine like SF uses 64 bit values. SF can be compiled to run on 64 bit hardware only or it can be compiled to run on both 32 bit and 64 bit hardware. When SF is running on 32 bit hardware or is running on 64 bit hardware but was compiled for 32 bit hardware a 64 bit bitboard operation has to be broken up into two 32 bit operations taking more time.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Why is the 64bit version normally faster than the 32 bit?

Post by Sven »

This is usually true for bitboard engines where processing of 64-bit numbers is being used heavily. A 32-bit version needs to emulate all operations on 64-bit numbers by twiddling with two 32-bit words instead of one 64-bit word.
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
User avatar
Kotlov
Posts: 266
Joined: Fri Jul 10, 2015 9:23 pm
Location: Russia

Re: Why is the 64bit version normally faster than the 32 bit?

Post by Kotlov »

Because 64 squares on a board ))
Eugene Kotlov
Hedgehog 2.1 64-bit coming soon...