ARM64各寄存器说明
2016-08-17 17:47
411 查看
详细参考:http://119.90.25.22/infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf
There are thirty-one, 64-bit, general-purpose (integer) registers visible to the A64 instruction set; these are labeled
r0-r30. In a 64-bit context these registers are normally referred to using the names x0-x30; in a 32-bit context the
registers are specified by using w0-w30. Additionally, a stack-pointer register, SP, can be used with a restricted
number of instructions. Register names may appear in assembly language in either upper case or lower case. In
this specification upper case is used when the register has a fixed role in this procedure call standard. Table 2,
General purpose registers and AAPCS64 usage summarizes the uses of the general-purpose registers in this
standard. In addition to the general-purpose registers there is one status register (NZCV) that may be set and
read by conforming code.
SP The Stack Pointer.
r30 LR The Link Register.
r29 FP The Frame Pointer
r19…r28 Callee-saved registers
r18 The Platform Register, if needed; otherwise a temporary register.See notes.
r17 IP1 The second intra-procedure-call temporary register (can be used by call veneers and PLT code); at other times may be used as a temporary register.
r16 IP0 The first intra-procedure-call scratch register (can be used by call veneers and PLT code); at other times may be used as a temporary register.
r9…r15 Temporary registers
r8 Indirect result location register
r0…r7 Parameter/result registers
The first eight registers, r0-r7, are used to pass argument values into a subroutine and to return result values from
a function. They may also be used to hold intermediate values within a routine (but, in general, only between
subroutine calls).
Registers r16 (IP0) and r17 (IP1) may be used by a linker as a scratch register between a routine and any
subroutine it calls (for details, see §5.3.1.1, Use of IP0 and IP1 by the linker). They can also be used within a
routine to hold intermediate values between subroutine calls.
The role of register r18 is platform specific. If a platform ABI has need of a dedicated general purpose register to
carry inter-procedural state (for example, the thread context) then it should use this register for that purpose. If
the platform ABI has no such requirements, then it should use r18 as an additional temporary register. The
platform ABI specification must document the usage for this register.
Note Software developers creating platform-independent code are advised to avoid using r18 if at all possible.
Most compilers provide a mechanism to prevent specific registers from being used for general allocation;
portable hand-coded assembler should avoid it entirely. It should not be assumed that treating the
register as callee-saved will be sufficient to satisfy the requirements of the platform. Virtualization code
must, of course, treat the register as they would any other resource provided to the virtual machine.
A subroutine invocation must preserve the contents of the registers r19-r29 and SP.
In all variants of the procedure call standard, registers r16, r17, r29 and r30 have special roles. In these roles they
are labeled IP0, IP1, FP and LR when being used for holding addresses (that is, the special name implies
accessing the register as a 64-bit entity).
Note The special register names (IP0, IP1, FP and LR) should be used only in the context in which they are
special. It is recommended that disassemblers always use the architectural names for the registers.
The NZCV register is a global condition flag register with the following properties:
The N, Z, C and V flags are undefined on entry to and return from a public interface.
There are thirty-one, 64-bit, general-purpose (integer) registers visible to the A64 instruction set; these are labeled
r0-r30. In a 64-bit context these registers are normally referred to using the names x0-x30; in a 32-bit context the
registers are specified by using w0-w30. Additionally, a stack-pointer register, SP, can be used with a restricted
number of instructions. Register names may appear in assembly language in either upper case or lower case. In
this specification upper case is used when the register has a fixed role in this procedure call standard. Table 2,
General purpose registers and AAPCS64 usage summarizes the uses of the general-purpose registers in this
standard. In addition to the general-purpose registers there is one status register (NZCV) that may be set and
read by conforming code.
SP The Stack Pointer.
r30 LR The Link Register.
r29 FP The Frame Pointer
r19…r28 Callee-saved registers
r18 The Platform Register, if needed; otherwise a temporary register.See notes.
r17 IP1 The second intra-procedure-call temporary register (can be used by call veneers and PLT code); at other times may be used as a temporary register.
r16 IP0 The first intra-procedure-call scratch register (can be used by call veneers and PLT code); at other times may be used as a temporary register.
r9…r15 Temporary registers
r8 Indirect result location register
r0…r7 Parameter/result registers
The first eight registers, r0-r7, are used to pass argument values into a subroutine and to return result values from
a function. They may also be used to hold intermediate values within a routine (but, in general, only between
subroutine calls).
Registers r16 (IP0) and r17 (IP1) may be used by a linker as a scratch register between a routine and any
subroutine it calls (for details, see §5.3.1.1, Use of IP0 and IP1 by the linker). They can also be used within a
routine to hold intermediate values between subroutine calls.
The role of register r18 is platform specific. If a platform ABI has need of a dedicated general purpose register to
carry inter-procedural state (for example, the thread context) then it should use this register for that purpose. If
the platform ABI has no such requirements, then it should use r18 as an additional temporary register. The
platform ABI specification must document the usage for this register.
Note Software developers creating platform-independent code are advised to avoid using r18 if at all possible.
Most compilers provide a mechanism to prevent specific registers from being used for general allocation;
portable hand-coded assembler should avoid it entirely. It should not be assumed that treating the
register as callee-saved will be sufficient to satisfy the requirements of the platform. Virtualization code
must, of course, treat the register as they would any other resource provided to the virtual machine.
A subroutine invocation must preserve the contents of the registers r19-r29 and SP.
In all variants of the procedure call standard, registers r16, r17, r29 and r30 have special roles. In these roles they
are labeled IP0, IP1, FP and LR when being used for holding addresses (that is, the special name implies
accessing the register as a 64-bit entity).
Note The special register names (IP0, IP1, FP and LR) should be used only in the context in which they are
special. It is recommended that disassemblers always use the architectural names for the registers.
The NZCV register is a global condition flag register with the following properties:
The N, Z, C and V flags are undefined on entry to and return from a public interface.
相关文章推荐
- ARM 寄存器说明
- ARM 寄存器说明
- ARM中的RO、RW和ZI DATA说明 .
- 关于ARM的pc寄存器的指向问题
- 从uImage到Image,arm64平台上Linux镜像的变化, Booti命令的使用
- Xcode8.3静态库libmp3lame.a无法真机运行!lame静态库libmp3lame.a 编译,支持arm64 armv7s x86_64 i386 armv7
- ARM指令的条件说明
- jni中arm64-v8a,armeabi-v7a,armeabi文件夹的意义和用法<转>
- Android 开发:开源库Speex支持arm64的动态库文件
- ARM寄存器中a1、ip的含义 ARM寄存器的别名
- 升级Xcode到6.1之后使用iPhone6真机测试cocos2d-x报错不支持arm64的解决方案(转)
- 43.Apple移动设备处理器指令集 armv6、armv7、armv7s及arm64
- Android 关于arm64-v8a、armeabi-v7a、armeabi、x86下的so文件兼容问题
- ARM寄存器介绍
- Android .so abi兼容,通用armeabi-v7a和arm64-v8a架构的方法
- Apple移动设备处理器指令集 armv6、armv7、armv7s及arm64
- ARM定义特殊寄存器(*(volatile unsigned long *))的理解
- ARM 关键几个寄存器
- Visual Studio 2017 15.9预览版3支持ARM64 for UWP
- armeabi-v7a armeabi arm64-v8a