[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: amd64: why is sizeof(int) =4? why not =8?



On Wed, Apr 05, 2006 at 06:48:29AM -0500, Mitchell Laks wrote:
> Hi,
> 
> I wanted to find out more about amd64, so I installed the debian distro 
> (etch/sid) on my amd64 dual core system. 
> 
> I wanted to see if it is really 64 bit. So naively i compiled the following 
> example program I found on the internet:
> 
... 
> Size of int is 4
> Size of short is 2
> Size of long is 8
well, i see 2 points:
first of all there are 2 things that can be 64bit in a processor:
adressing and data that can be processed in one op...
so the addressing on amd64 is 64 bit (virutal, hw is only 48 bit at the
moment)...
i don't know about the data bandwith of the alu, though i think it is 64
bit..

and another:
the implemnetation of the c compiler does not have to be the same as the
hw bandwith...

also...long is only 4 bytes (32 bit) on normal i386 cpus...

yours
albert



Reply to: