| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Apart from all the other issues one could talk about, I'll talk about the basic library issue. If you do build a snippet of code using 64-bit pointers, make sure you don't link it with any 32-bit code, including all system libraries (including an existing libSystem.dylib). That code is expecting pointers to be 32-bit -- calling [32-bit] strlen() with a 64-bit pointer quantity may or may not work out. It depends on what the instructions inside the [32-bit] function are doing, and where sizeof(void *)==4 has been hard-coded into them by the compiler, such as in effective address computations. And I doubt that the "indexed" instructions like lswx, when executed by the processor in 32-bit mode, will do the right thing if there is a 64-bit pointer in the source register (except perhaps in 'lucky' situations). Vararg functions or functions with stack-based arguments (where the amount of data for each item on the stack has been hard-coded by compilation) will also be trouble. The same goes for kernel APIs potentially (depends on whether the kernel thinks that vm_address_t, vm_size_t, natural_t, int, and so on are 32-bit or 64-bits inside; though, in some cases it shouldn't matter, like a 32-bit flags argument being passed in, in a larger register)._______________________________________________
libSystem could possibly rebuilt 64-bit, if you figure out how to do that (and I don't know). As long as there are no sizeof(void *)==4 assumptions in the C sources or in the hand-coded assembly. And the kernel APIs are still a separate issue that I don't know anything specific about.
The OS will run the task in 32-bit mode. One would have to test to see if there is a performance difference. If the processor being in a 32-bit mode doesn't affect the bus/memory/cache subsystem (that is, the L1 cache is still filled in the same way with the same speed), then it's conceivable that a 32-bit program may run faster than a 64-bit one for certain operations, like searching through an array of N-bit ints (since the 32-bit program would be loading twice as many 32-bit ints into the L1 cache in the same amount of time), even if there were a small in-processor performance difference.
| References: | |
| >Re: 64 bit addressing (From: Chris Kane <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.