InvestorsHub Logo
icon url

HailMary

03/16/04 8:50 PM

#28915 RE: Petz #28912

what was the size of the integeres you sorted in both modes?

Both were 32 bit integers. 'int' is 32 bits in both 32-bit and 64-bit. Long and pointers track the arch. I'm considering doing a 64-bit integer sort as a comparison. I'll try it out later and report. It looks like I can use 'long long', as that is 64-bits in both 32-bit and 64-bit mode. The compiler is supposed to emulate 64-bit on 32-bit platforms and go native on 64-bit. We'll see if that holds true or not.

PS, by habit I always use long instead of int when I know that I need 32 bits.

Better change your habits! Long is now 64-bits in x86-64. From the gcc man page:
 
-m32
-m64
Generate code for a 32-bit or 64-bit environment. The 32-bit
environment sets int, long and pointer to 32 bits and generates
code that runs on any i386 system. The 64-bit environment sets
int to 32 bits and long and pointer to 64 bits and generates
code for AMD's x86-64 architecture.