AAPCS - dongyeoplee87/DYLee GitHub Wiki
- AArch32 : Thumb mode <-> ARM mode
- AArch64 : A64만 존재, Instruction은 32bit이지만 General purpose register는 64 or 32bit 사용
- Branches
- Conditional branches
- B.cond
- CBZ/CBNZ
- TBZ/TBNZ
- Conditional operations
- CSEL : Condition에 따라 register를 선택함
- CSINC/CSIVN/CSNEG
- Floating-point operations
- 앞에 F가 붙으면 Floating point를 위한 명령어
- SIMD(Single Instruction Multiple Data) Operations
- 하나의 명령어로 여러번의 연산 수행
- Vectors
- Vn.xy : n번째 레지스터, x개의 element 갯수, y개의 element size
- Condition codes
- EQ : 같을 시 z-register가 1로 Set
- A32와의 차이점
- ToDo
31개의 GPR, 31개의 Floating point registers
- R0 ~ R7 : Parameter / result register
- 8개가 넘는 parameter는 stack을 통해 전달 됨
- R8 : 함수의 return값이 64bit를 초과하면 간접 결과 주소를 저장
- R9 ~ R15 : Temporary register
- local variable의 개수가 많아지면 사용
- R16, R17 : Veneer 등에서 서브 루틴 호출 사이의 중간값을 위한 임시 register (ARM <-> Thumb)
- R18
- User mode일 시, Thread ID등에 활용
- Kernel mode일 시, Kernel 구조체 등에 활용
- R19 ~ R28 : Callee-saved register
- Caller function의 값이 callee function 이후에도 보존이 필요할 때 사용
- R29 : Frame pointer
- Caller function의 stack pointer를 저장
- R30 : Link register
- Branch 하기 전 복귀할 주소를 저장
- SP : Stack pointer
- V0 : Returmn value
- V0 ... V7 : Arguments of function call
- V8 ... V15 :
- Parameter는 8개 이하로
- 자주 호출되는 함수는 Inline 키워드로 선언