64 bit Systems
Moderator: Coders of Rage
- davidthefat
- Chaos Rift Maniac
- Posts: 529
- Joined: Mon Nov 10, 2008 3:51 pm
- Current Project: Fully Autonomous Robot
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: California
- Contact:
64 bit Systems
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.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: 64 bit Systems
Yes.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?
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: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.
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.davidthefat wrote:The downside of using all 64bit integers is the extra space it takes up on memory.
Re: 64 bit Systems
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.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"