The document discusses the introduction of ARM 64-bit architecture. It begins with an introduction of the speaker and then covers several topics on ARM64 including:
- ARM64 terminology such as AArch64 for 64-bit mode and AArch32 for 32-bit mode
- The ARM64 execution model including 64-bit general purpose registers and 128-bit floating point registers
- The ARM64 instruction set architecture including new instructions for cache control and floating point support
- Demonstrations of ARM64 assembly code for various C examples compiled to ARM64
- Trying out ARM64 emulation using QEMU to debug ARM64 code with GDB.
1 of 33
Downloaded 153 times
More Related Content
ARM 64bit has come!
1. 1
ARM 64bit has come!
Tetsuyuki Kobayashi
2014.5.23 Japan Technical Jamboree
2014.5.25 Updated for カーネル /VM 探検隊
2. 2
The latest version of this slide will
be available from here
http://www.slideshare.net/tetsu.koba/presentati
ons
3. 3
Who am I?
20+ years involved in embedded systems
10 years in real time OS, such as iTRON
10 years in embedded Java Virtual Machine
Now GCC, Linux, QEMU, Android, …
Blogs
http://d.hatena.ne.jp/embedded/ (Personal)
http://blog.kmckk.com/ (Corporate)
http://kobablog.wordpress.com/(English)
Twitter
@tetsu_koba
4. Today's topics
Introduction of ARM 64bit
But does not cover all, only
something interesting for me :)
Try aarch64 using QEMU
6. 6
ARM64 is not official name
In the kernel source
arch/arm64
7. Exception level
4 levels
Typical usage
EL0: User application
EL1: Kernel of OS
EL2: Hypervisor
EL3: Secure monitor
Aarch64/aarch32 can change between
exception level
CF. PL0-PL2 (Privilege level) at ARMv7
8. Aarch64 execution model
R0 – R30: 64bit length general purpose
registers
Wn: lower 32bit
Xn: 64bit
32th register means zero register(XZR, WZR) or SP
SP: Stack Pointer
Must be 16 byte aligned
WSP for lower 32bit
PC: Program Counter
Can not use for calculate destination
9. Aarch64 execution model (cont.)
V0 – V31: 128 bit length registers
For floating point and SIMD
Aarch64 must have FPU. No calling standard for
soft-float.
Scalar
Bn, Hn, Sn, Dn, Qn
Vector
Vn.8B, Vn.16B, Vn.4H, Vn.8H, Vn.2S, Vn.4S,
Vn.1D, Vn.2D
FPCR: Floating Point Control Register
FPSR: Floating Point Status Register
10. Aarch64 addressing model
Without tag: 64bit virtual address
With tag: 8bit tag + 56bit virtual address
Tag is ignored when load/store/branch
Good for implementing type-less languages
Effective virtual address length is 48bit.
11. Calling standard (AAPCS64)
R30 = LR (Link Register)
R29 = FP (Frame Pointer)
Parameter passing
R0 – R7 for integer and pointer
V0 – V7 for float
Callee must preserve
R19 – R29, SP
V8 – V15
No calling standard for soft-float
12. A64 instruction set
Brand-new, clean design for 64bit architecture
Not all, very small set of ”conditional data
processing” instructions
No equivalent of Thumb2's IT instruction.
13. No multiple load/store
No multiple load/store GP registers such
as LDM/STM, PUSH/POP
Instead, there are 2 register load/store
such as LDP/STP
14. YIELD instruction
NOP with hinting not important
Use in spin-loop and trigger context
switching in SMT(Symmetric Multi-
Threading)
15. Sample #1 source
#include <stdio.h>
int main()
{
int i;
for (i = 5; i >=0; i--) {
printf("count down: %dn", i);
}
return 0;
}
18. Sample #2 source
int iaload(int *base, int index)
{
return base[index];
}
long long laload(long long *base, int index)
{
return base[index];
}
char ibload(char *base, int index)
{
return base[index];
}
short isload(short *base, int index)
{
return base[index];
}
24. Cache control
Application level cache instructions
Data cache
DC VAU
DC CVAC
DC CIVAC
Instruction cache
IC IVAU
No need to call kernel syscall
JIT friendly