Page 1 of 1

64 bit Systems

Posted: Mon Sep 05, 2011 11:02 pm
by davidthefat
Since Windows uses the LLP64 model. Is it okay to just use 64 bit integers instead of 32 bit integers all throughout the program? Is it going to be any slower to use 32 bit integers on a 64 bit system because the system constantly has to put the number in the right part of the register. The downside of using all 64bit integers is the extra space it takes up on memory.

Re: 64 bit Systems

Posted: Tue Sep 06, 2011 11:17 am
by Falco Girgis
davidthefat wrote:Since Windows uses the LLP64 model. Is it okay to just use 64 bit integers instead of 32 bit integers all throughout the program?
Yes.
davidthefat wrote:Is it going to be any slower to use 32 bit integers on a 64 bit system because the system constantly has to put the number in the right part of the register.
No. That's not the way it works. It's loaded directly into the correct half of the register in a single operation as it would be a 32-bit CPU. Otherwise x86 applications would run like shit under x64...
davidthefat wrote:The downside of using all 64bit integers is the extra space it takes up on memory.
Yes, and generally speaking, unless you're doing some low-level things with pointers and memory-mapped IO with devices on a 32-bit address space, that's the only downside.

Re: 64 bit Systems

Posted: Wed Sep 07, 2011 5:48 pm
by avansc
also take note of how you lay out structures, specially if they have pointers in them, you can end up wasting a lot of space. not that it really matters. but if you were curious.