Why ARM’s 64-bit architecture is good for developers and good for users

by: Gary SimsSeptember 12, 2014
460

ARM big.little Cortex-a57/a53The history of 64-bit computing is quite varied and interesting. Companies like Cray started using 64-bit registers in their systems in the mid-1970s, however pure 64-bit computing didn’t really come about until the 1990s. First came the R4000 from MIPS, and then the Alpha processor from DEC. By the mid-1990s Intel and Sun both had 64-bit designs, however the real turning point for consumers came in 2003 when AMD released a 64-bit PC processor that was compatible with Intel’s 32-bit x86 processors.

ARM saw the need for energy-efficient 64-bit processors and started working new designs long before announcing its new ARMv8-A architecture.

Fast forward 10 years, PC sales are in decline and most smartphones and tablets have multi-core processors running at speeds of between 1 and 2GHz. However these devices use a 32-bit architecture and not a 64-bit architecture like modern PCs and servers. Until now that was perfectly acceptable. Smartphones weren’t meant to compete with PCs in terms of performance and the processors needed to be energy efficient to maximize battery life.

However as devices have developed and new technologies like voice recognition, realistic 3D gaming and high resolution displays, have become the norm, the humble 32-bit processor is slowly being pushed towards its limits.

ARM saw the need for energy-efficient 64-bit processors and started working new designs long before announcing its new ARMv8-A architecture, the first ARM architecture to include a 64-bit instruction set. ARM also learnt from the mistakes and successes of other chip designers who moved to 64-bits. ARM’s new 64-bit architecture is fully compatible with its 32-bit architecture. This means that if the processor is running on a 64-bit enabled operating system, the processor is able to run unmodified ARMv7 32-bit binaries. For Android this means that once the kernel has been ported to 64-bits (and it has already thanks to Linaro) then the rest of the OS, from core libraries to apps and games, can be either 32-bit or 64-bit.

linaro_plus_aarch64

Last year Apple shook the mobile world when it announced that the iPhone 5S would use the new 64-bit Apple A7 processor. The A7 includes an Apple designed ARMv8 dual-core CPU, called Cyclone.  It uses two 64KB L1 caches (one for each core), a 1MB L2 cache shared by both CPU cores, and a 4 MB L3 cache for the entire SoC. Apple holds an ARM architecture license which means it can design its own processors from scratch, but with the provision that these processors must be ARM compatible. ARM has a series of test suites which it runs against such processors to ensure compatibility.

Over the next few months we are going to see 64-bit ARM based processors coming from companies like Samsung, Qualcomm and MediaTek. When coupled with the 64-bit work being done on Android, it is clear that we will see 64-bit devices running on a 64-bit version of Android before long. But what do 64-bit processors mean to developers and end-users?

Benefits of ARM’s 64-bits

At the heart of every CPU is a set of registers. These are internal storage slots which store numbers and addresses. If you want to add 5 to a number then one way to do it would be to tell the CPU to add 5 to the contents of a register, say register 7 (R7) and place the result in R8. The same applies to other operations like subtract, multiply, shift and so on.

The ARMv8 architecture has 31 general registers, each 64-bits wide.

When the processor is performing complex operations these slots are used and re-used constantly. If all the registers are currently occupied then the only way to proceed is to store one of the registers in memory, use the register for the next task, and then load the previous value back in from memory. In human terms this can all happen at lightning speeds, but for a processor this is actually a time consuming sequence of events and it is not very efficient.

The 32-bit ARMv7 architecture had 15 general purpose registers, each 32-bits wide. The ARMv8 architecture has 31 general registers, each 64-bits wide. This means that optimized code should be able to use the internal registers more often than memory, and that these registers can hold bigger numbers and addresses. The result is that ARM’s 64-bit processors can do things quicker.

In terms of energy efficiency, the use of 64-bit registers doesn’t increase the power usage. In some cases the fact that a 64-bit core can perform certain operations quicker means that it will be more energy efficient than a 32-bit core, simply because it gets the job done faster and can then power down.

ARMv8 AArch64 performance vs. AArch32 fig1

 

The other aspect of 64-bit processors is the addressing. In the world of PCs and servers the 32-bit barrier was primarily talked about in terms of accessible memory. If you wanted more than 4GB of RAM then you need a 64-bit processor. This isn’t strictly true with ARM processors as some ARMv7 processors can access more than 4GB of memory using its Large Physical Address Extensions (LPAE). With LPAE a Cortex-A15 processor can address 1024GB of memory. Since 64-bits is over 2 million terabytes, there aren’t going to be any smartphones that need full 64-bit addressing any day soon! Since catering for address space that is never going to be used is futile, the ARMv8 architecture has 48 bit addressing, that is 256 terabytes!

OK, I don’t expect any games that needs terabytes of memory in the immediate future, but back down at the other end of the scale such address capabilities are very important. Modern 3D games often come with huge amounts of resources (assets), these assets can be more easily memory mapped when there is greater than 4GB of address space. This will speed up games and allow for direct access to the games media resources.

ARM AArch64 Performance Improvements

More than just smartphones and tablets

The benefits of 64-bit computing on ARM aren’t limited to just smartphones and tablets. ARM’s eco system is vast and its processors are found in many different types of devices. One area where ARM processors haven’t made much in roads is in the server market. As the information age continues to advance the amount of energy used to power all those data centers is increasing rapidly. Any reduction in power usage saves money and saves on natural resources. Putting 64-bit ARM chips in servers has several other benefits than just the reduced power usage. These servers are passively cooled which means that you can cram them together without the worry of over heating. It also means that less money is spend on cooling.

armv8

In terms of server software, operating systems like Linux are already 64-bit and there is support for ARMv8 already in the mainline kernel. This means that servers running 64-bit Linux on ARM won’t be hard to build, or sell!

Chromebooks are another area where ARMv8 could become dominant. There are ARMv7 Chromebooks already and I am sure it won’t be long before we see ARMv8 ones.

Wrap up

The age of 64-bit mobile computing is upon us, mainly thanks to ARM. These new processors are faster and open up mobile platforms to a whole range of new possibilities, all while staying true to ARM’s low-power heritage.

The migration path from 32-bit to 64-bit is well trodden and there shouldn’t be any surprises for developers going from 32-bit to 64-bit on ARM, regardless of the OS.

ARM’s partners will be producing Cortex-A53 and Cortex-A57 processors over the coming months, some will work in the more standard dual-core and quad-core configurations, while some will work together in big.LITTLE setups. And one thing is sure, this is an exciting time for ARM and for all of us who use the processors based on their designs.

  • Anonymousfella

    “Since 64-bits is approximately the number of atoms in a small galaxy, there aren’t going to be any smartphones that need full 64-bit addressing any day soon! ”

    For those who didn’t get this part, 64bit= (2)^64= 18,446,744,073,709,551,616 bits

    In gb terms thats 17,179,869,184 GB!

    • MasterMuffin

      ~17 exabytes :P

    • Chris

      Well, can’t we fit around 18 millions of 1TB drives on earth? I think we already did. And if so, then why 64bits is approx. the number of atoms in small galaxy? One bit on HDD takes more space than just one atom, so we can easily tell that the number of atoms in galaxy is much much larger.

    • Omegaclawe

      Uh… no. The number of Atoms is in a liter of hydrogen is about 6.022×10^23. 2^64 is only 1.845×10^19, or less than a ten-thousandth of those atoms. Meanwhile, the number of atoms on Earth is on the order of 1.33×10^50, which would require at least 167 bits to express each one as a single, binary bit. In the observable universe, this number jumps up to approximately 10^80, requiring ~ 266-bits of addressable storage. Meanwhile, the volume of the observable universe is about 2.2×10^183 plancks, which requires 610 bits to express. Given that at least 10 bits are necessary to cover that in the memory address space, at minimum, a simulation of the observable universe would require an address space of 277 bits.

      tl;dr – We’re going to have to keep expanding this number until we hit 512 bits or we’ll keep running into limits.

      • thartist

        Wow!

      • Simon Belmont

        Maybe by “the number of atoms in a small galaxy” he meant the number of atoms in a Galaxy S5 mini. Har har har.

        I’m so funny. I’ll just see myself out now.

      • DM

        That’s what I was saying.

  • MasterMuffin

    Now if only I could just swap a new SoC in my N5… I don’t want a new phone yet!

    “which is runs” :)

    • Amuro Ray

      Let me swap your nexus 5 soc with exynos variant khehehehe >:D

      • MasterMuffin

        At least it’s not MediaTek!

        • Tyrion Lannister

          The new exynos kicks a$$.

          See the screenshots. Also they use the Cortex a57 +a53 combo in HMP and mali t760mp16 GPU .

          I think it’s the best SoC available. In comparison, even the s805 only manages 3.3k on 2.7 GHz.

          • Andrew T Roach

            It’s the best available, but its still just Stock ARM cores. The same as Mediatek and Qualcomm will be using.

            Nvidia is the only Android chip maker doing anything custom with Denver K1? Kinda sad.

          • Just Awesome

            I think the Tegra K1 should be the best CPU of this year. My compliment for Nvidia. The Denver cores on Tegra K1 are much promising than any other cores, likewise the GPU on Tegar K1. It’s better if Nvidia can design chips for smartphones again.

            I have another question. Isn’t that Qualcomm’s Krait cores good enough????

          • MasterMuffin

            That’s not the problem…

    • Mike Reid

      Phoneblox.

      IMO, 64 bits, in and of itself, won’t help much. Same as on PCs, unless you have apps that need Gigabytes of RAM like busy databases, but that’s a server then and not a PC.

      Yes, the 64 bit SOCs WILL be faster, but that will be mostly due to other improvements. If they had a 32 bit mode we’d see maybe 10-20% improvement, same as on PCs with 32 and 64 bit modes.

      For a dev such as myself, it will likely require 2 sets of NDK/JNI libraries and any binary executables. So that’s extra work with no real gain for a dev. Maybe in 3 years we can ignore old 32 bit support.

      OTOH, Android L will require many changes too, and might as well do them all at the same time. And with RAM on mobile about to exceed 4 GB, now is the time for 64 bit addressing.

    • crutchcorn

      Ara on the way

  • cee

    If the Tour de France was run backwards you’d win, I haven’t seen such back peddling in years.

    Oh and you forgot about Apples G5 64-bit powerpc with 64-bit OS in 2003. Funny how you remembered AMDs 64-bit chip running 32-bit OS but not the system from the same year that was fully 64-bit.

    Wouldn’t want HaemorRoiders to realise how late they are to the party. Keep writing for sheep who know nothing.

    • I am sorry but I don’t understand you references to “back peddling”. I don’t remember ever writing anything against 64-bit computing. How am I back peddling?

      Also I didn’t mention the G5 processor just like I didn’t mentioned lots of different 64 designs. The reason I mentioned AMD’s design is because it was the turning point in terms of consumer accessible to 64-bit computing. I don’t think the same can be said about the G5.

      • cee

        Nice to hear from the author, props for responding.

        Back-peddling: I am referring to your site as a whole, you have to admit, in the last couple of weeks, suddenly Roiders think 1gb of ram is sufficient. Do you not see the irony here? Suddenly it isn’t just addressing memory or marketing ploys.

        To be honest, I was ribbing you about the G5, why would you want to mention Apple in a positive light (or having been in 64-bit way before any current competitor) when writing for a ‘Roid site?

        Anyone who was in the industry in the 90’s & 00’s know that 64-bit was only really Apple/IBM/Motorola (the PowerPC alliance) & Sun Sparc systems. Sun and IBM workstations were ridiculously expensive, no consumer bought those. Many consumers bought G5’s, even a school janitor I know bought one.

        But to mention a CPU with no software/OS, this was not a consumer experience of 64-bit, they were owning hardware with no actual software to experience it (which is closer to how Andy will launch I suppose, no OS, no software, and doubtful that the phone will even be able to run a 64-bit version of Andy.).

        Microsoft only brought out 64-bit server software a few years later, and considering that most consumers still use Windows home edition, I think the chances are that no consumer (on Windows anyway) even experienced a true 64-bit system until very recently.

        Even today, most Windows 64-bit machines still run a majority of 32-bit software.

        Where as the G5 had an architecture, OS and software, was cheap compared to Windows/Sun/IBM boxes and were really the first popular launch of 64-bit systems.

        I guess I am old and have seen it all going back to the 80’s, when Apple was 32-bit and Microsoft was running 8/16-bit. They used the same arguments then as they do today about how its unnecessary and just it’s just ‘marketing’, the only difference is they are now calling themselves Roiders instead of Microsofties.

        Isn’t it funny how people never really change….

        • I guess I am old too, I was working for DEC when they released the Alpha AXP and 64-bit versions of VMS and OSF/1. However I don’t really agree with your analysis about the G5. Mac sales have always been low compared to PC sales (especially back then). It was AMD who brought 64-bit computing to the masses, however I do agree that Microsoft was late with 64-bit versions of Windows, but then again I was running Linux on my AMD64 system at the time!

          As for the whole site back peddling, I don’t see that for three reasons: 1) 64-bit computing isn’t just about address space, there is so much more. 2) I don’t recall any specific articles which advocate 1GB as being sufficient for every use case (maybe you could point me to some). 3) The iPhone 5 and 6 have 1GB of RAM or less, which underlines my point that 64-bit computing isn’t about address space, particularly on mobile.

  • rjr162

    “If you wanted more than 4GB of RAM then you need a 64-bit processor.”

    Its not true since Intel introduce PAE long ago in their early 32-bit CPUs… Linux has been able to address more, although an individual “App” could only address up to roughly 4GB. Windows can with a kernel hack but by licensing and design MS never enabled it for your average joe

    • I think context is important when reading… What I actually wrote was: “In the world of PCs and servers the 32-bit barrier was **primarily talked about** in terms of accessible memory.” Notice the phrase “primarily talked about”. Which is true, the average guy on the street (and even readers of Android Authority) talk about the 32-bit barrier in terms of addressing. The next sentence in context wasn’t a declaration but rather a summary of what was being talked about. Context. Further more, the next line then says that you could break the 32-bit addressing barrier on some ARMv7 processors.

      Since this is *not* an article about the the 32-bit addressing modes of different processors, I then don’t go on to expand on the different ways to exceed 32-bit addressing, regardless of the architecture.

  • Andrew T Roach

    Nobody should really be buying flagships right now unless they aren’t concerned about future proofing. Snapdragon 805 won’t even see any these benefits and its a “new” SoC.

  • Marc Gottlieb

    After 64-bit Android available, will developer be forced to release 64-bit apps only, or can they release both 32-bit and 64-bit apps?

    In PC world, we know some big software company often release their apps in both 32-bit and 64-bit, to cater user that still use either 32 or 64 bit OS.

    So I’m wondering if we will see similar issue with 32 and 64 bit Android OS in the future.

    • As far as I understand it, Java doesn’t have the notion of 32-bit or 64-bit code, this should mean that most apps will still ship one version that works across the different processors. For NDK apps it might be different.

      • Colin

        Since Java uses its own platform-independent bytecode, the only thing that has to be updated is the VM. Not only will older apps still run, but they’ll see an immediate benefit without any modifications due to the more efficient low-level ops in the VM. Typical Java development is so far removed from memory management that most developers won’t even have to change a line of code. Compiled code (NDK, Objective-C), however, will have to be re-compiled, and in some cases, augmented to run on a 64-bit processor (requiring a new build target for every supported processor: x64, mips 64, armv8, etc.). That’s why Apple worked so hard to be early with introducing 64-bit: they had much more work to do to get developers ready for the switch.

        • Colin

          That’s also why iOS apps run so efficiently on less powerful hardware: most everything is compiled ahead of time, vs. Dalvik’s compiling on the fly (JIT). With ART, everything that can be pre-compiled is now done so upon app installation, while dynamic code is still supported with compiling on the fly. Yet again, you’ll see a tremendous speed up, but developers who use less dynamically-interpreted code would gain yet another efficiency boost.

  • The-Sailor-Man

    Is this an Apple side?? Advocating Apples 64 bit BS???
    .
    Well we know that 64 bit is better. No need to convince us.
    The point is that 64 bit should be done on smartphones when can be taken use of it.
    You make it big now, to favour your favourite brand. Right?