Apple’s iPhone 5s, the A7 Chip, and That 64-Bit Question
allthingsd.com
allthingsd.com
Basically, I don't see any evidence behind the "next generation architecture" stuff. Certainly ARMv8 itself isn't a huge leap -- it cleans some things up in the ISA (no more condition bits, IP is no longer a register, the multi-reg push/pop instructions are gone, ...) but as all of that is still required for 32 bit execution it isn't going to clean up the implementation on its own.
If this is a great new CPU with great new features, they have to tell us that. I think the 64-bit messaging is really "shorthand" for what you wanted to hear from Apple.
But you didn't, because they didn't say anything.
So yes, by saying that it's "2x faster," Apple actually did fairly strongly say that it includes major microarchitectural improvements over the core design in the A6, much like we know there to be between the Cortex A15 and A57.
We're seriously supposed to have an informed discussion about CPU architecture based on marketing copy? No.
This is what I thought too..
So is Gruber exaggerating when he says "There are serious performance gains by going 64-bit. Addressing more than 4 GB of memory is not the only advantage"?
1. This has nothing to do with 64-bitness, it could just as easily have been applied to a 32-bit iteration of the ARM ISA. (You're not saying it does, but many, including the linked article, do.) Widening the GPRs to 64-bits means that the number of bits of architectural register space is actually quadrupled (there are 2x as many, each of which is 2x as wide).
2. Performance scales (very) sublinearly with the number of available architectural registers.
3. The number of physical registers in the microarchitectural implementation may be unchanged, or may even be lower, than any given implementation of ARMv7. It is unlikely that this "Swift 2" core has fewer physical registers than the A6's "Swift 1", but ARMv8 just sets a higher lower-bound on the number of physical registers, and makes it modestly easier for a compiler to express a given piece of code with fewer spills. In reality, the number of physical GPRs in Swift 1 was likely already >= 32 due to register renaming (https://en.wikipedia.org/wiki/Register_renaming).
Plus a lot of people are ignoring the fact that 64 bit means that everything in 64 bit mode consumes more RAM and more storage space.
e.g.
- Shell32.dll (Windows 64): 18.8 MB
- Shell32.dll (Windows 32): 16.7 MB
13% increase in size. This applied to every binary on the system both in RAM and in storage (assuming you don't need two copies for 32 bit compatibility which is highly highly likely).
So if they increase the RAM on the iPhone 5S almost all of the "increase" might be consumed by the new 64 bit migration and if they have a 32 bit compatibility mode running then you're talking about having less free RAM than the old iPhone did for apps etc.
Apple, as far as I know, haven't released how much RAM they'll be adding to the 5S. If they double the iPhone 5's RAM this might all be a non-issue, but you still won't gain as much free as you might initially imagine per above.
On a clean phone none of those 32bit libraries will be resident in memory, since all of their own apps are already updated.
If a user starts an older 3rd-party app then that process will incur some overhead, until it exits.
Since Apple's frameworks have already been through this transition on the desktop, the average 3rd party app will likely make this transition easily with a build target setting.
I'm sure older games, like the original Infinity Blade, may never make this transition. I doubt any users will notice, though.
What interests me more are the doubled FP registers available to SIMD instructions. Would all of the image processing that is done automatically by the new camera software in the 5S have even been possible without this added performance? I suspect this is a benefit of AArch64 that can be directly linked to a specific user experience.
In addition, there are other interesting across-the-board performance improvements enabled by 64bit pointers. Namely, the same one that they got on the desktop OS when Lion was introduced:
Apple has apparently taken advantage of the 64-bit runtime in Lion by optimizing the Objective C runtime itself to use some of these extra bits for, shall we say, clever purposes. Bavarious describes an optimization through which Apple is able to replace previously full-fledged opaque objects such as NSNumber with an object-placeholder that exists entirely as the 64-bit “object address” itself. This means that, for a wide range of “simple” objects, no additional memory allocation is required, and no retain/release memory management is required for the “object.”
That's just a tagged pointer, language runtimes have been doing that for decades (lisp machines even had hardware support for tagged pointers)
Basically: more registers means less spilling and filling to memory, but more work in context switches and for non-leaf function calls to save the extra data. It's all about tradeoffs. Note that no one ever went to a 64 GPR ISA (Itanium and Sparc have more than 32, but they do it with a stack engine that takes the work off the user code for the most part).
ARMv8 is clean and nice, and 64 bit computation is clearly the future just as it is in the desktop world. But it's not a revolution (again, just as it wasn't in the desktop world) and we shouldn't try to make it one.
In the immediate future, this will make zero difference for consumers. Applications that ship today will continue to be compiled as 32-bit, so that they can run on all the other iOS devices as well. Since the iPhone 5s is likely to be faster than all those other iOS devices as well, there's little point right now optimizing an application for the iPhone 5s, everything that runs well enough on an iPhone 4s or iPhone 5 or iPhone 5c will run well enough on an iPhone 5s as well. Optimize for the low end, and the high end will take care if itself.
In the medium term, there will come a moment in time when all supported iOS devices have 64-bit support, with Apple dropping support for 32-bit devices. At that point, the iPhone 5s will be the oldest supported iOS devices, and the iPhone 5c won't be supported any more. Indirectly, that means that the iPhone 5s will have a longer useful life than the iPhone 5c, and since the difference between 32-bit and 64-bit is qualitative and not quantitative, it's possible that the useful life of an iPhone 5s will be more than one year longer than that of the iPhone 5c. Users who care about how long they can keep their phones before being forced to replace them because of obsolescence could consider the more expensive iPhone 5s over an iPhone 5c on this point alone, regardless of the other differences.
Finally, 64-bit support in the iPhone 5s is a great stepping stone for developers. Even though deploying 64-bit-only applications might not be practical for another few years, it's never too early to make sure that code compiles for 64-bit targets and passes all the unit tests, to run microbenchmarks, and maybe even for some dogfooding. In the long term, I can't rule out that Apple would remove 32-bit support entirely and would therefore mandate 64-bit applications, and it's probably easier to get ready on an ongoing basis than to go through a 64-bit fire drill many years down the road.
I fully expect that the common dependencies (see: AFNetworking, Google Analytics, etc) will be 64-bit ready in, at most, a few months, at which point shipping a 64-bit app will be as simple as flipping a compile switch.
It's difficult to imagine the 5c having within $100 of the trade in value of the 5s in a couple years, and therefore little chance of making sense, even if you think a 4% discount on the two-year TCO matters. (approximately $2500 vs $2600)
Also, Android doesn't use Oracle's JVM. It uses Dalvik which Oracle doesn't control. And Linux already supports 64-bit operation and has for a long time. It's only recently supported 64-bit ARM, though, and Android will need to grab a more recent version of the Linux kernel if they want to use 64-bit ARM.
When Android supports 64-bit ARM they'll also benefit much more than Apple from the main advantage of 64-bit addressing when using less than 4 GB of memory: easier garbage collection. The larger your address space the less a random collection of bits will happen to constitute a valid pointer to a memory location.
Did you even read the article?
"Double the register file adds a few percent to performance,” he said. “It’s a deep compiler and runtime VM issue. … So marginal improvements for most apps, at best."
“This means that for some codes, the A7 will be twice as fast (or faster depending on how many memory accesses the original code had) to run code because the processor doesn’t have to use main memory as much.”
But I'm not sure if the kernel support will be enough for Android to be "64-bit", or if they need to make the Dalvik VM 64-bit, too? And can they even make Dalvik support both 64-bit and 32-bit, or how would that work?
I've just read this part:
> “This will not be true with Android, by the way. The Android Java app and native app environment will need support from Oracle, who owns the Java environment.
That almost makes you disregard everything that guy said prior to that. He probably thinks Google is actually using the JVM.
Native code is a different story, of course.
Now that Apple has their kernel running on a modern 64 bit architecture, it would almost be crazy for them NOT to focus on putting their specially optimized A8 core into their notebooks.
(Memory addressing info from ARM re: LPAE and ARMv8: http://infocenter.arm.com/help/topic/com.arm.doc.den0001c/DE...)
And because of MMIO you don't even get 4GB virtual in 32b.
iOS does not use a swap file[1] the way he is describing.
[1]: https://developer.apple.com/library/ios/documentation/Perfor... - fourth paragraph
I have this feeling Apple will "inevitably" put Mac OS on its own ARMv8 chips once they get "powerful enough" to sustain a "full OS" like Mac OS (they might wait until A8 or A9 to do that), and then sell like a $700 Air-like machine with keyboard and a larger screen than iPad, that would still be very profitable for them, because of how little an ARM chip costs compared to Intel Core chips.
But I'm also certain Apple wouldn't do that if Mac apps wouldn't be easily ported to the ARM architecture. That's why I think Apple missed a big opportunity to ensure any Mac Store app is cross-platform between x64 and ARMv8 by default. But have they done anything recently under the hood that could make that possible anyway in the future?
Mac OS X is likely ready to go on ARM right now, with just a push of a button to build it. I'd be utterly shocked if Apple weren't maintaining an ARM build of OS X internally.
If and when Apple decides to make an ARM-based Mac, we will probably only know it when it actually shows up, because the groundwork is fairly solid. The only thing that's lacking is encouraging third-party developers to cross-compile, and given Apple's famous secrecy, it's highly unlikely they'll give any advance warning just for that.
I guess I missed the whole "we're port your Mac Apps to the iPhone" part of the keynote.
As for RAM, I found a good paper. http://www.nicta.com.au/pub?doc=3587 If you go to the top of page 13, you'll see that RAM accounts for less than about 5% of all power usage. Given that cpus and radios in modern smartphones can use a bit more power, you're looking at even less. So I'd say ram is negligible towards power usage, so the amount doesn't have a power constraint.
None. Apple is not going to quadruple RAM from one generation to the next.