I am writing a simple C program with SDL2 which utilizes some techniques from Handmade Hero. I wish for it to support gnu/linux, windows, macos, iphoneos and android OS's. As I understand it, the common cpu architectures one may encounter on these OS's are x86_64, i386, arm and arm64. I have some questions regarding these different architectures:
1. For an x86_64 cpu, is there any benefit to compiling for i386? i.e. compile 32 bit application to be run on 64bit OS. If not, are there really that many 32bit OS's that people still use to play games to make it worth supporting?
2. Across these architectures, will Handmade Hero's
typedef float real32; typedef double real64;
still be accurate? i.e. does a float on 64bit take 32bits but on other architectures does it take a different amount?
3. I like the idea of using fixed sized data types where possible, i.e. u32 over int. However, across these architectures, is there a particular size I should favor?
4. Are there any other notable things to be thinking about when supporting these various architectures when programming? (I know intrinsics are one thing)
Sorry if these are basic questions, I'm just having trouble distinguishing between the differences in these architectures and how that affects the C code you are writing.
As I know the compiler used influences these things, for gnu/linux, windows and macos I am using llvm clang. For iphoneos xcode and android android studio.