Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: bool versus BOOL in C++

Author: Gerd Isenberg

Date: 08:59:47 09/26/03

Go up one level in this thread


>The reason why int doesn't have a specific size is that on each system int was
>meant to be the fastest type of variable, word sized. That's why using int is
>better than char even for small numbers (except when having large arrays where
>int would waste too much cache). For the same reason I think typedef int BOOL
>would be better than bool when having only speed in mind.
>
>P.S. It seems that on 64 bit systems sizeof(int) will still be 4, not word
>sized. Wouldn't an 8 byte int be faster than a 4 byte one on a 64 bit system?!
>

Probably not for AMD64. This "hybrid" CPU is designed to work even well with
32-bit Data in 64-bit mode, using the "old" x86-32 registers. With MSC for AMD64
even sizeof(long) is still 4. Remember "the big waste" of cache and memory
ressources - more than 50% for zero- or sign-extensions, more than 75% zero
bits.

Not sure about Alpha, G5 and Itanium. I heared "early" Alphas had some
performance problems with partial register handling.

Gerd



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.