1. ABI
3. 语法 (指令解释中的各种概念是什么)
4. 该指令是否会影响其他的东西
1. PSTATE
2. PC
3. SP
5. 指令中的地址 寻址方式是什么
6. 想要用的指令在哪个类
7. 指令如何编码
8. 是否为特权指令
9. 是否为SIMD&FP指令
有效VA范围由以下因素决定:
• 实现的虚拟地址空间的大小。 由 内存管理单元MMU 相关寄存器配置设置。
TCR.T1SZ
TCR.T0SZ
ARMv8-A架构下,它的低位有效位数(也就是虚拟地址空间大小),是可以配置的,最大48位,最小12位.
不过,为了方便页表的对齐,我们通常会设置一些特定的位数.比如48,39,30.
在代码中,你可以看到有关T0SZ,T1SZ的设置,就是用来配置这个项目的.
有效位数为64-TxSZ (或者,也可以说TxSZ是用来设置高位无效位数的)
The only instructions that can read the PC are those that generate a PC relative address:
• ADR and ADRP.
• The Load register (literal) instruction class.
• Direct branches that use an immediate offset.
• The unconditional branch with link instructions, BL and BLR, that use the PC to create the return link address.
Only explicit control flow instructions can modify the PC:
• Conditional and unconditional branch and return instructions.
• Exception generation and exception return instructions.
以 SP 作为输入
A64 instructions can use the stack pointer only in a limited number of cases:
• Load/Store instructions use the current stack pointer as the base address:
— When stack alignment checking is enabled by system software and the base register is SP, the current stack pointer must be initially quadword aligned,
That is, it must be aligned to 16 bytes. Misalignment generates an SP alignment fault. See SP alignment checking on page D1-2287 for more information.
• Add and subtract data processing instructions in their immediate and extended register forms, use the current stack pointer as a source register or the destination register or both.
• Logical data processing instructions in their immediate form use the current stack pointer as the destination register.
以 PSTATE 作为输出
The A64 base instructions that use the Condition flags as an input are:
• Conditional branch. The conditional branch instruction is B.cond .
• Add or subtract with carry. These instruction types include instructions to perform multi-precision arithmetic and calculate checksums. The add or subtract with carry instructions are ADC , ADCS , SBC , and SBCS , or an architectural alias for these instructions.
• Conditional select with increment, negate, or invert.This instruction type conditionally selects between one source register and a second, incremented, negated, inverted, or unmodified source register. The conditional select with increment, negate, or invert instructions are CSINC , CSINV , and CSNEG .
These instructions also implement:
— Conditional select or move. The Condition flags select one of two source registers as the destination register. Short conditional sequences can be replaced by unconditional instructions followed by a conditional select, CSEL .
— Conditional set. Conditionally selects between 0 and 1, or 0 and -1. This can be used to convert the Condition flags to a Boolean value or mask in a general-purpose register, for example. These instructions include CSET and CSETM .
• Conditional compare. This instruction type sets the Condition flags to the result of a comparison if the original condition is true, otherwise it sets the Condition flags to an immediate value. It permits the flattening of nested conditional expressions without using conditional branches or performing Boolean arithmetic within the general-purpose registers.The conditional compare instructions are CCMP and CCMN .
以 PSTATE 作为输出
The A64 base instructions that update the Condition flags as an output are:
• Flag-setting data processing instructions, such as ADCS , ADDS , ANDS , BICS , RMIF , SBCS , SETF8 , SETF16 , and SUBS , and the aliases CMN , CMP , and TST .
• Conditional compare instructions such as CCMN , CCMP .
• The random number generation instructions MRS RNDR and MRS RNDRRS , see Effect of random number generation instructions on Condition flags on page C6-752.
直接改变 PSTATE
The A64 base instructions that manipulate the Condition flags are:
• The flag manipulation instruction CFINV , which inverts the value of the Carry flag.
A64 Base Instruction Descriptions
• If ARMv8.5-CondM is implemented, the base instructions AXFLAG and XAFLAG . These instructions convert between the Arm floating point comparison PSTATE condition flag format and an alternative format shown in Table C6-1.
The flags can be directly accessed for a read/write using the NZCV, Condition Flags on page C5-400.
The A64 base instructions also include conditional branch instructions that do not use the Condition flags as an input:
• Compare and branch if a register is zero or nonzero, CBZ and CBNZ .
• Test a single bit in a register and branch if the bit is zero or nonzero, TBZ and TBNZ .
Effect of random number generation instructions on Condition flags
If ARMv8.5-RNG is implemented, then:
• When a valid random number is returned, the PSTATE.NZCV flags are set to 0b0000 .
• If the random number hardware is not capable of returning a random number in a reasonable period of time, the PSTATE.NZCV flags are set to 0b0100 , and the random number generation instructions return the value 0.
Note
The definition of “reasonable period of time” is IMPLEMENTATION DEFINED . The expectation is that software might use this as an opportunity to reschedule or run a different routine, perhaps after a small number of retries have failed to return a valid value.value.
.inst
.word
add
adrp
and
asr
b
b.cc
b.cs
b.eq
b.ge
b.gt
b.hi
b.le
b.ls
b.lt
b.ne
bl
blr
brk
cmn
cmp
cneg
csel
cset
eret
ldp
ldr
ldrb
ldrh
ldrsw
lsl
lsr
mov
movk
mrs
msr
mul
neg
nop
orr
ret
smull
stp
str
strb
strh
stur
sub
svc
sxtb
sxth
sxtw
udiv
umull
wfi
通用寄存器(31个)
X0 - X30
SIMD&FP registers(32个+2)
V0 - V31
PC寄存器
PC
状态寄存器(1个)
PSTATE
特殊寄存器(27个)
• CurrentEL, that holds PSTATE.EL, and that software can read to determine the current Exception level.
• DAIF, that holds the current PSTATE.{D, A, I, F} interrupt mask bits.
• DIT, that holds the PSTATE.DIT bit.
• NZCV, that holds the PSTATE.{N, Z, C, V} condition flags.
• PAN, that holds the PSTATE.PAN state bit.
• SPSel, that holds PSTATE.SP, that at EL1 or higher selects the current SP.
• SSBS, that holds the PSTATE.SSBS bit.
• TCO, that holds the PSTATE.TCO bit.
• UAO, that holds the PSTATE.UAO bit.
• ELR_EL1, that holds the address to return to for an exception return from EL1.
• SPSR_EL1, that holds process state on taking an exception to AArch64 EL1.
• FPCR, that provides control of floating-point operation.
• FPSR, that provides floating-point status information.
• SP_EL0, that holds the stack pointer for EL0.
• SP_EL1, that holds the stack pointer for EL1.
• DLR_EL0, that holds the address to return to for a return from Debug state.
• DSPSR_EL0, that holds process state on entry to Debug state