32 bit or 64 bit

Started by
7 comments, last by Bacterius 11 years, 9 months ago
i'm making a game for the mac app store.


is it smarter to make it 32 bit or 64 bit?
Advertisement
How about... both?

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

Since you can put both versions into the same package, yes: make both.
Aren't most macs 64 bit capable anyway. Failing that a 32 bit package will run on 64 bit OSx anyway.
Does a 32 bit OS process code with 64 bit numbers (long, ulong) properly? I was under the impression that if you use 64bit operators, you need to run it on a 64bit OS.
Does a 32 bit OS process code with 64 bit numbers (long, ulong) properly? I was under the impression that if you use 64bit operators, you need to run it on a 64bit OS.
Depends on the CPU architecture that your compiler is targeting. Regular, portable x86 code won't have the instructions/registers to do 64-bit ops in a single instruction; the compiler will have to use a few instructions to implement long long operations.
But there is a new ABI coming up that uses the 64-Bit extensions on 32-Bit code.
If you need the 64-Bit data size for a special purpose so you are bound to use them you can use the types from stdint.h
They are fixed in size across different environments. This way you need not to know how long or long long is realized within the used environment.
stdint.h is not part of the MS compilers. But there are some versions around in the net that work with MS.
But there is a new ABI coming up that uses the 64-Bit extensions on 32-Bit code.
That's Linux though, and still experimental / half finished.

As for "32 or 64 bit", my opinion is that if you have to ask, then you can just stick with 32 bit. 64 bit operating systems allow running 32 bit code just fine. A few rare operations might be slightly more expensive, but pointers are only half the size (which makes a big difference).
If you do need 64 bits, then you already know (you've already run out of address space once), you need not ask.

You really only need 64 bit if you have a dataset of considerably more than a gigabyte or two that you wish to keep in memory (mapped or otherwise). Most programs work just fine with a "normal" 2GB address space (which can be 4GB at no extra cost under a 64 bit OS if you only set the appropriate flag in the executable).
Guys, this is a mac application though, from what I can find there aren't any macs running OSX as 32 bit anymore apart from the old PowerPC models

Guys, this is a mac application though, from what I can find there aren't any macs running OSX as 32 bit anymore apart from the old PowerPC models

Still, with the proper portability conventions followed, producing both versions should be effortless and would allow the application to run on those old PowerPC models too smile.png

Of course, if applying those conventions would take a rewrite, it's probably not worth the time mellow.png so good point. +1

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

This topic is closed to new replies.

Advertisement