There has been some speculation on the net about what sort of processor is in the A6 SoC found in the iPhone 5. The two dominant choices are either a quad core version of the Cortex A9 found in previous versions of the Apple SoCs or a new dual core version of the Cortex A15, which until now has not been found in any shipping product. Without access to actual devices, it would seem the odds are stacked against us in determining what the actual CPU is.
Except that with the latest Xcode now has support for building for a new architecture -- armv7s. There is little to go on about what the differences are between armv7s and armv7, so I decided to look in the opposite direction. I went with the assumption that if Apple is using an Cortex A15, they would want to support any new instructions provided. And therefore, I went and found out what was added in the A15 vs the A9.
It turns out there are a handful of new instructions. Most of the features seem to be oriented around virtualization support, which wouldn't be of any use to an iOS developer. But there were two instructions added that could be very useful -- a "fused" multiply and add instruction (MAC) and more importantly, an integer divide instruction. This later one is interesting because currently if division is required on the armv7 platform, the compiler inserts a call to a helper function to carry out the division in software.
My plan was then as follows. I would build a test application for both armv7 and armv7s. In this application, I made a test function that was as follows:
int my_divide(int a, int b) { return a / b; }
I built the project and then when diving into ~/Library/Developer/Xcode looking for the .o files for both the arm7 and arm7s version. Since I didn't have an arm7s disassembler handy, I chose to use nm instead. nm will list all of the unresolved external symbols used in the .o file. Since the software division routine would need to be linked in, my expectation was that on the armv7 version, I would see an unresolved symbol for that routine and on the armv7s version, there would be no unresolved symbol.
Here's what I got when I ran it on the armv7 version:
$ nm File.o U ___divsi3 00000000 T _my_divide
Here is what I got when I rant it on the armv7s version:
$ nm File.o 00000000 T _my_divide
As expected, the armv7s version did not call into the software division routine. Therefore, I am reasonably confident that the armv7s architecture variant (and most likely the A6 SoC) is for the Cortex A15 processor.