Does 64-bit A7 provide any actual performance boost?

The answer is no, but let me explain why

Suyash Srijan

--

Smartphone SoC’s get faster every year but Apple’s microprocessors have always been behind Qualcomm’s, the leader of the system on a chip market. But this year, Apple did something unexpected. Apple announced the newest variant of its Swift microprocessor called A7, just like it does at every iPhone unveiling event, but with a twist: It’s based on a custom implementation of the ARMv8 instruction set architecture, which means it’s 64-bit capable. It also has twice the amount of GP and SP registers a typical chip based on ARMv7 ISA has. People literally went nuts after hearing this, specially the fanboys but Apple can't fool the educated. If you think the A7 64-bit chip will result in everything will be crazy fucking fast on your shiny new iPhone 5S then you are totally wrong. The benefit of having a 64-bit chip, even with kernel and stock apps completely rewritten to support 64-bit gives you absolutely zero advantage.

It’s important to know about the chip itself and what ARMv8 and 64-bit means before you begin reading the rest of my post:

What is A7?

A7 is a new Swift dual core microprocessor designed by Apple and based on the ARMv8 instruction set architecture and compatible with ARMv7. The cores are clocked at 1.7 GHz and is rumored to have a integrated PowerVR Series 6 GPU. The only device that currently has the A7 microprocessor is the iPhone 5S, which was announced yesterday.

What is ARMv8?

ARMv8 is a ISA for ARM system on a chips and it supports the new A64 instruction set and AArch64 64-bit architecture. New features include double the amount of SP and GP registers, some new registers and support for memory translation from 48-bit virtual addresses based Large Physical Address Extension. In-depth details can be found here: http://www.arm.com/files/downloads/ARMv8_Architecture.pdf

What is 64-bit?

If a processor/SoC is 64-bit enabled, it means the processor/SoC has registers and address/data buses that are 64-bits wide. Each 64-bit register can store 2 to the power of 64 different values, thus enabling it to directly access 2 to the power of 64 bytes of byte-addressable memory, which is 16 Exbibytes. A 32-bit processor/SoC can only access 2 to the power of 32 bytes of byte addressable memory, which is 4 Gigabytes.

Note: Data and address buses can sometimes be of different lengths.

Why 64-bit is useless on smartphones?

For three reasons. Let’s talk about memory addressing first:

If you have a 32-bit processor on your computer, the operating system has, in theory, access to approximately 4 gigabytes of physical memory since when the OS is running in x86 protected mode, with paging enabled, you get 2 to the power of 10 page directories and inside each page directory, you get 2 to the power of 10 page tables with each page being 2 to the power of 12 bytes long, thus effectively giving you 4294967296 bytes of byte-addressable memory. Due to memory mapped I/O, the actual memory available to the operating system is slightly lower though. Since the operating system can only, at any given point of time, access a maximum of 4 gigabytes of physical memory, if you plan to upgrade the amount of RAM installed on your computer to something greater than 4 gigabytes, you have to upgrade to a 64-bit operating system and a 64-bit CPU as well, in order to take advantage of all the extra physical memory.

PS: You can also enable PAE in kernel (LPAE on ARM) to access more than 4 gigabytes of physical memory (while being limited to 4 gigabytes of virtual address space per process) but having a 64-bit operating system and CPU is much better.

If you didn't understand anything I said above, don't worry, here’s a simpler explanation: 64-bit allows you to access more than 4 gigabytes of RAM.

The above concept applies to ARM SoCs as well. An ARM system on a chip also comes in two flavors, 32-bit and 64-bit, just like a desktop processor. A 32-bit ARM SoC can only access up to 4 gigabytes of physical memory and the 64-bit one can access more than 4 gigabytes of physical memory. How much physical memory does the iPhone 5S have? Only a gigabyte and that means there’s no point of having a 64-bit CPU and operating system since 64-bit is only effective when you have more than 4 gigabyte of physical memory.

The second reason is, register size.

A processor register is a memory location on the CPU which is constructed using flip-flops and allow us to quickly store and load data (faster than physical memory). There are a variety of registers available and the number and type of registers depends on the instruction set of the CPU. A 32-bit register can address 2 to the power of 32 memory addresses where as a 64-bit register can address 2 to the power of 64 memory addresses. Most applications you use, like Chrome, do not require 32-bit wide registers. Only heavy applications like Photoshop and 3ds Max and heavy games like Crysis take advantage of 64-bit instructions. The same applies to smartphone applications as well. Most (or should I say all?) of the smartphone apps do not take advantage of 64-bit wide registers since such apps does not require such a wide register set to operate. Infact, when apps, that don't take advantage of 64-bit registers, are recompiled as a 64-bit binary, the performance of the app can actually decrease since larger memory addresses will fill up the cache faster and the operating system will have to deal with registers that are double in size but contain only half the data.

There were some people who said while the register size is useless for smartphone apps, it can be utilized by the GPU. That is totally incorrect since OpenGL ES 3.0 only supports 32-bit transforms so the 64-bit architecture doesn't benefit graphics performance in any way.

The third reason is, DRAM and code. There will be an increased usage of the DRAM prefetch buffer and code size will dramatically increase when apps are recompiled to support 64-bit, unless the code is properly optimized for 64-bit. This will lead to battery drain and more memory consumption on the device.

Conclusion

While the new A7 chip is indeed faster than the previous A6 chip, having a 64-bit architecture does not offer any actual performance boost. There’s a reason why other companies like Samsung and HTC haven’t launched 64-bit enabled phones yet (Android doesn't support 64-bit so they couldn't but that’s not the only reason). Having a 64-bit CPU along with more than 4 gigabyte of physical memory on a smartphone is practically pointless and will substantially decrease the battery life. Unless all the iOS apps are recompiled and optimized for 64-bit (something that will take years), there is no benefit of having a 64-bit CPU, other than to showoff. When you design a microprocessor, you try your best to cut down on power consumption, rather than making it consume more doing things that aren't even essential. ARM designed the 64-bit architecture for servers (read more here and here), since servers use a lot of physical memory and do things that require 64-bit wide registers but Apple’s move to make it available to smartphones is entirely stupid.

GP: General purpose (register)
SP: Stack pointer (register)
ARM:
Advanced RISC Machines, a company that designs RISC based chips based on its own architecture called ARM.

Apple doesn't publicize how much RAM its devices have so the 1GB RAM claim was derived from the following pattern:

iPhone (also known as iPhone 2G): 128MB DRAM
iPhone 3G: 128MB DRAM
iPhone 3GS: 256MB DRAM
iPhone 4: 512MB DRAM
iPhone 4S: 512MB DRAM
iPhone 5: 1GB DRAM
iPhone 5S: 1GB DRAM (
makes sense)

--

--

Suyash Srijan

Entrepreneur. Hardcore Programmer. Technology Journalist at @skotgat