AArch64

From HandWiki
Short description: 64-bit extension of the ARM architecture

AArch64 or ARM64 is the 64-bit extension of the ARM architecture family.

Armv8-A platform with Cortex-A57/A53 MPCore big.LITTLE CPU chip

It was first introduced with the Armv8-A architecture. Arm releases a new extension every year.[1]

ARMv8.x and ARMv9.x extensions and features

Announced in October 2011,[2] ARMv8-A represents a fundamental change to the ARM architecture. It adds an optional 64-bit architecture, named "AArch64", and the associated new "A64" instruction set. AArch64 provides user-space compatibility with the existing 32-bit architecture ("AArch32" / ARMv7-A), and instruction set ("A32"). The 16-32bit Thumb instruction set is referred to as "T32" and has no 64-bit counterpart. ARMv8-A allows 32-bit applications to be executed in a 64-bit OS, and a 32-bit OS to be under the control of a 64-bit hypervisor.[3] ARM announced their Cortex-A53 and Cortex-A57 cores on 30 October 2012.[4] Apple was the first to release an ARMv8-A compatible core (Cyclone) in a consumer product (iPhone 5S). AppliedMicro, using an FPGA, was the first to demo ARMv8-A.[5] The first ARMv8-A SoC from Samsung is the Exynos 5433 used in the Galaxy Note 4, which features two clusters of four Cortex-A57 and Cortex-A53 cores in a big.LITTLE configuration; but it will run only in AArch32 mode.[6]

To both AArch32 and AArch64, ARMv8-A makes VFPv3/v4 and advanced SIMD (Neon) standard. It also adds cryptography instructions supporting AES, SHA-1/SHA-256 and finite field arithmetic.[7]

Naming conventions

  • 64 + 32 bit
    • Architecture: AArch64
    • Specification: ARMv8-A
    • Instruction sets: A64 + A32
    • Suffixes: v8-A
  • 32 + 16 (Thumb) bit
    • Architecture: AArch32
    • Specification: ARMv8-R / ARMv7-A
    • Instruction sets: A32 + T32
    • Suffixes: -A32 / -R / v7-A
    • Example: ARMv8-R, Cortex-A32[8]

AArch64 features

  • New instruction set, A64
    • Has 31 general-purpose 64-bit registers.
    • Has dedicated zero or stack pointer (SP) register (depending on instruction).
    • The program counter (PC) is no longer directly accessible as a register.
    • Instructions are still 32 bits long and mostly the same as A32 (with LDM/STM instructions and most conditional execution dropped).
      • Has paired loads/stores (in place of LDM/STM).
      • No predication for most instructions (except branches).
    • Most instructions can take 32-bit or 64-bit arguments.
    • Addresses assumed to be 64-bit.
  • Advanced SIMD (Neon) enhanced
  • A new exception system
    • Fewer banked registers and modes.
  • Memory translation from 48-bit virtual addresses based on the existing Large Physical Address Extension (LPAE), which was designed to be easily extended to 64-bit.

Extension: Data gathering hint (ARMv8.0-DGH)

AArch64 was introduced in ARMv8-A and is included in subsequent versions of ARMv8-A. It was also introduced in ARMv8-R as an option, after its introduction in ARMv8-A; it is not included in ARMv8-M.

Instruction formats

The main opcode for selecting which group an A64 instruction belongs to is at bits 25-28.

A64 instruction formats
Type Bit
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved op0 0000 op1 Immediate constant 16 bits
Unallocated 0001
SVE Instructions 0010
Unallocated 0011
Data Processing — Immediate PC-rel. op immlo 10000 immhi Rd
Data Processing — Immediate Others sf 100 01-11 Rd
Branches + System Instructions op0 101 op1 op2
Load and Store Instructions op0 1 op1 0 op2 op3 op4
Data Processing — Register sf op0 op1 101 op2 op3
Data Processing — Floating Point and SIMD op0 111 op1 op2 op3

ARMv8.1-A

In December 2014, ARMv8.1-A,[9] an update with "incremental benefits over v8.0", was announced. The enhancements fell into two categories: changes to the instruction set, and changes to the exception model and memory translation.

Instruction set enhancements included the following:

  • A set of AArch64 atomic read-write instructions.
  • Additions to the Advanced SIMD instruction set for both AArch32 and AArch64 to enable opportunities for some library optimizations:
    • Signed Saturating Rounding Doubling Multiply Accumulate, Returning High Half.
    • Signed Saturating Rounding Doubling Multiply Subtract, Returning High Half.
    • The instructions are added in vector and scalar forms.
  • A set of AArch64 load and store instructions that can provide memory access order that is limited to configurable address regions.
  • The optional CRC instructions in v8.0 become a requirement in ARMv8.1.

Enhancements for the exception model and memory translation system included the following:

  • A new Privileged Access Never (PAN) state bit provides control that prevents privileged access to user data unless explicitly enabled.
  • An increased VMID range for virtualization; supports a larger number of virtual machines.
  • Optional support for hardware update of the page table access flag, and the standardization of an optional, hardware updated, dirty bit mechanism.
  • The Virtualization Host Extensions (VHE). These enhancements improve the performance of Type 2 hypervisors by reducing the software overhead associated when transitioning between the Host and Guest operating systems. The extensions allow the Host OS to execute at EL2, as opposed to EL1, without substantial modification.
  • A mechanism to free up some translation table bits for operating system use, where the hardware support is not needed by the OS.
  • Top byte ignore for memory tagging.[10]

ARMv8.2-A

In January 2016, ARMv8.2-A was announced.[11] Its enhancements fell into four categories:

Scalable Vector Extension (SVE)

The Scalable Vector Extension (SVE) is "an optional extension to the ARMv8.2-A architecture and newer" developed specifically for vectorization of high-performance computing scientific workloads.[12][13] The specification allows for variable vector lengths to be implemented from 128 to 2048 bits. The extension is complementary to, and does not replace, the NEON extensions.

A 512-bit SVE variant has already been implemented on the Fugaku supercomputer using the Fujitsu A64FX ARM processor. It aims to be the world's highest-performing supercomputer with "the goal of beginning full operations around 2021."[14]

SVE is supported by the GCC compiler, with GCC 8 supporting automatic vectorization[13] and GCC 10 supporting C intrinsics. As of July 2020, LLVM and clang support C and IR intrinsics. ARM's own fork of LLVM supports auto-vectorization.[15]

ARMv8.3-A

In October 2016, ARMv8.3-A was announced. Its enhancements fell into six categories:[16]

  • Pointer authentication[17] (AArch64 only); mandatory extension (based on a new block cipher, QARMA[18]) to the architecture (compilers need to exploit the security feature, but as the instructions are in NOP space, they are backwards compatible albeit providing no extra security on older chips).
  • Nested virtualization (AArch64 only)
  • Advanced SIMD complex number support (AArch64 and AArch32); e.g. rotations by multiples of 90 degrees.
  • New FJCVTZS (Floating-point JavaScript Convert to Signed fixed-point, rounding toward Zero) instruction.[19]
  • A change to the memory consistency model (AArch64 only); to support the (non-default) weaker RCpc (Release Consistent processor consistent) model of C++11/C11 (the default C++11/C11 consistency model was already supported in previous ARMv8).
  • ID mechanism support for larger system-visible caches (AArch64 and AArch32)

ARMv8.3-A architecture is now supported by (at least) the GCC 7 compiler.[20]

ARMv8.4-A

In November 2017, ARMv8.4-A was announced. Its enhancements fell into these categories:[21][22][23]

  • "SHA3 / SHA512 / SM3 / SM4 crypto extensions"
  • Improved virtualization support
  • Memory Partitioning and Monitoring (MPAM) capabilities
  • A new Secure EL2 state and Activity Monitors
  • Signed and unsigned integer dot product (SDOT and UDOT) instructions.

ARMv8.5-A and ARMv9.0-A[24]

In September 2018, ARMv8.5-A was announced. Its enhancements fell into these categories:[25][26]

  • Memory Tagging Extension (MTE)[27]
  • Branch Target Indicators (BTI) to reduce "the ability of an attacker to execute arbitrary code",
  • Random Number Generator instructions – "providing Deterministic and True Random Numbers conforming to various National and International Standards"

On 2 August 2019, Google announced Android would adopt Memory Tagging Extension (MTE).[28]

In March 2021, ARMv9-A was announced. ARMv9-A's baseline is all the features from ARMv8.5.[29][30][31] ARMv9-A also adds:

  • Scalable Vector Extension 2 (SVE2). SVE2 builds on SVE's scalable vectorization for increased fine-grain Data Level Parallelism (DLP), to allow more work done per instruction. SVE2 aims to bring these benefits to a wider range of software including DSP and multimedia SIMD code that currently use Neon.[32] The LLVM/Clang 9.0 and GCC 10.0 development codes were updated to support SVE2.[32][33]
  • Transactional Memory Extension (TME). Following the x86 extensions, TME brings support for Hardware Transactional Memory (HTM) and Transactional Lock Elision (TLE). TME aims to bring scalable concurrency to increase coarse-grained Thread Level Parallelism (TLP), to allow more work done per thread.[32] The LLVM/Clang 9.0 and GCC 10.0 development codes were updated to support TME.[33]
  • Confidential Compute Architecture (CCA)[34][35]
  • Scalable Matrix Extension (SME).[36] SME adds new features to process matrices efficiently, such as:
    • Matrix tile storage
    • On-the-fly matrix transposition
    • Load/store/insert/extract tile vectors
    • Matrix outer product of SVE vectors
    • "Streaming mode" SVE

ARMv8.6-A and ARMv9.1-A[24]

In September 2019, ARMv8.6-A was announced. Its enhancements fell into these categories:[37]

  • General Matrix Multiply (GEMM)
  • Bfloat16 format support
  • SIMD matrix manipulation instructions, BFDOT, BFMMLA, BFMLAL and BFCVT
  • enhancements for virtualization, system management and security
  • and the following extensions (that LLVM 11 already added support for[38]):
    • Enhanced Counter Virtualization (ARMv8.6-ECV)
    • Fine-Grained Traps (ARMv8.6-FGT)
    • Activity Monitors virtualization (ARMv8.6-AMU)

For example, fine-grained traps, Wait-for-Event (WFE) instructions, EnhancedPAC2 and FPAC. The Bfloat16 extensions for SVE and Neon are mainly for deep learning use.[39]

ARMv8.7-A and ARMv9.2-A[24]

In September 2020, ARMv8.7-A was announced. Its enhancements fell into these categories:[40]

  • Enhanced support for PCIe hot plug (AArch64)
  • Atomic 64-byte load and stores to accelerators (AArch64)
  • Wait For Instruction (WFI) and Wait For Event (WFE) with timeout (AArch64)
  • Branch-Record recording (ARMv9.2 only)

ARMv8.8-A and ARMv9.3-A[24]

In September 2021, ARMv8.7-A and ARMv9.3-A was announced. Their enhancements fell into these categories:[41]

  • Non-maskable interrupts (AArch64)
  • Instructions to optimize memcpy() and memset() style operations (AArch64)
  • Enhancements to PAC (AArch64)
  • Hinted conditional branches (AArch64)

Armv8-R (real-time architecture)

Optional AArch64 support was added to the Armv8-R profile, with the first Arm core implementing it being the Cortex-R82.[42] It adds the A64 instruction set, with some changes to the memory barrier instructions.[43]

References

  1. "Overview". Learn the architecture: Understanding the Armv8.x and Armv9.x extensions. https://developer.arm.com/documentation/102378/0201. 
  2. "ARM Discloses Technical Details Of The Next Version Of The ARM Architecture" (Press release). Arm Holdings. 27 October 2011. Archived from the original on 1 January 2019. Retrieved 20 September 2013.
  3. Grisenthwaite, Richard (2011). "ARMv8-A Technology Preview". https://www.arm.com/files/downloads/ARMv8_Architecture.pdf. 
  4. "ARM Launches Cortex-A50 Series, the World's Most Energy-Efficient 64-bit Processors" (Press release). Arm Holdings. Retrieved 31 October 2012.
  5. "AppliedMicro Showcases World's First 64-bit ARM v8 Core" (Press release). AppliedMicro. 28 October 2011. Retrieved 11 February 2014.
  6. "Samsung's Exynos 5433 is an A57/A53 ARM SoC". AnandTech. https://www.anandtech.com/show/8537/samsungs-exynos-5433-is-an-a57a53-arm-soc. 
  7. "ARM Cortex-A53 MPCore Processor Technical Reference Manual: Cryptography Extension". ARM. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0500e/CJHDEBAF.html. 
  8. "Cortex-A32 Processor – ARM". https://www.arm.com/products/processors/cortex-a/cortex-a32-processor.php. 
  9. Brash, David (2 December 2014). "The ARMv8-A architecture and its ongoing development". https://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development. 
  10. "Top-byte ignore (TBI)". https://en.wikichip.org/wiki/arm/tbi. 
  11. Brash, David (5 January 2016). "ARMv8-A architecture evolution". https://community.arm.com/groups/processors/blog/2016/01/05/armv8-a-architecture-evolution. 
  12. "The scalable vector extension sve for the ARMv8 a architecture" (in en). Arm Community. 22 August 2016. https://community.arm.com/processors/b/blog/posts/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture. 
  13. 13.0 13.1 "GCC 8 Release Series – Changes, New Features, and Fixes – GNU Project – Free Software Foundation (FSF)" (in en). https://gcc.gnu.org/gcc-8/changes.html. 
  14. "Fujitsu Completes Post-K Supercomputer CPU Prototype, Begins Functionality Trials – Fujitsu Global". www.fujitsu.com (Press release). Retrieved 8 July 2018.
  15. "⚙ D71712 Downstream SVE/SVE2 implementation (LLVM)". https://reviews.llvm.org/D71712. 
  16. David Brash (26 October 2016). "ARMv8-A architecture – 2016 additions". https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/armv8-a-architecture-2016-additions. 
  17. "[Ping~,AArch64 Add commandline support for -march=armv8.3-a"]. https://patches.linaro.org/patch/90145/. "pointer authentication extension is defined to be mandatory extension on ARMv8.3-A and is not optional" 
  18. "Qualcomm releases whitepaper detailing pointer authentication on ARMv8.3". 10 January 2017. https://www.qualcomm.com/news/onq/2017/01/10/qualcomm-releases-whitepaper-detailing-pointer-authentication-armv83. 
  19. "A64 Floating-point Instructions: FJCVTZS". http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.100069_0610_00_en/hko1477562192868.html. 
  20. "GCC 7 Release Series – Changes, New Features, and Fixes". https://gcc.gnu.org/gcc-7/changes.html. "The ARMv8.3-A architecture is now supported. It can be used by specifying the -march=armv8.3-a option. [..] The option -msign-return-address= is supported to enable return address protection using ARMv8.3-A Pointer Authentication Extensions." 
  21. "Introducing 2017's extensions to the Arm Architecture" (in en). https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/introducing-2017s-extensions-to-the-arm-architecture. 
  22. "Exploring dot product machine learning" (in en). https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/exploring-the-arm-dot-product-instructions. 
  23. "ARM Preps ARMv8.4-A Support For GCC Compiler – Phoronix" (in en). https://www.phoronix.com/scan.php?page=news_item&px=GCC-ARMv8.4-A-Patches. 
  24. 24.0 24.1 24.2 24.3 "ARMv8.x and ARMv9.x extensions and features". Learn the architecture: Understanding the ARMv8.x and ARMv9.x extensions. https://developer.arm.com/documentation/102378/0201/ARMv8-x-and-ARMv9-x-extensions-and-features. 
  25. "Arm Architecture ARMv8.5-A Announcement – Processors blog – Processors – Arm Community" (in en). https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-a-profile-architecture-2018-developments-armv85a. 
  26. "Arm Architecture Reference Manual ARMv8, for ARMv8-A architecture profile" (in en). https://developer.arm.com/docs/ddi0487/ea. 
  27. "Arm MTE architecture: Enhancing memory safety" (in en). https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/enhancing-memory-safety. 
  28. "Adopting the Arm Memory Tagging Extension in Android" (in en). https://security.googleblog.com/2019/08/adopting-arm-memory-tagging-extension.html. 
  29. "Arm's solution to the future needs of AI, security and specialized computing is v9" (in en). https://www.arm.com/company/news/2021/03/arms-answer-to-the-future-of-ai-armv9-architecture. 
  30. Schor, David (30 March 2021). "Arm Launches ARMv9" (in en-US). https://fuse.wikichip.org/news/4646/arm-launches-armv9/. 
  31. Frumusanu, Andrei. "Arm Announces ARMv9 Architecture: SVE2, Security, and the Next Decade". https://www.anandtech.com/show/16584/arm-announces-armv9-architecture. 
  32. 32.0 32.1 32.2 "Arm releases SVE2 and TME for A-profile architecture – Processors blog – Processors – Arm Community" (in en). https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/new-technologies-for-the-arm-a-profile-architecture. 
  33. 33.0 33.1 "Arm SVE2 Support Aligning For GCC 10, LLVM Clang 9.0 – Phoronix". https://www.phoronix.com/scan.php?page=news_item&px=Arm-SVE2-GCC10-Clang9. 
  34. "Unlocking the power of data with Arm CCA" (in en). https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/unlocking-the-power-of-data-with-arm-cca. 
  35. "Arm Introduces Its Confidential Compute Architecture" (in en-US). 23 June 2021. https://fuse.wikichip.org/news/5699/arm-introduces-its-confidential-compute-architecture/. 
  36. "Scalable Matrix Extension for the ARMv9-A Architecture" (in en). https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/scalable-matrix-extension-armv9-a-architecture. 
  37. "Arm A profile architecture update 2019" (in en). https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a. 
  38. "LLVM 11.0.0 Release Notes". https://releases.llvm.org/11.0.1/docs/ReleaseNotes.html. 
  39. "BFloat16 extensions for ARMv8-A" (in en). https://community.arm.com/developer/ip-products/processors/b/ml-ip-blog/posts/bfloat16-processing-for-neural-networks-on-armv8_2d00_a. 
  40. Weidmann, Martin (21 September 2020). "Arm A-Profile Architecture Developments 2020". ARM. https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2020. 
  41. Weidmann, Martin (8 September 2021). "Arm A-Profile Architecture Developments 2021". ARM. https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2021. 
  42. Frumusanu, Andrei (3 September 2020). "ARM Announced Cortex-R82: First 64-bit Real Time Processor". https://www.anandtech.com/show/16056/arm-announces-cortexr82-first-64bit-real-time-processor. 
  43. "Arm Architecture Reference Manual Supplement - Armv8, for Armv8-R AArch64 architecture profile". Arm Ltd.. https://developer.arm.com/documentation/ddi0600/ac.