The following template modifiers are specific to AArch64 state.
In AArch64 state, register operands are printed as X registers for
integer types and V registers for floating-point and vector types by default. You can use the
template modifiers to override this behavior.
a
Operand constraint must be r. Prints the
register name surrounded by square brackets. Suitable for use as a memory
operand.
w
Operand constraint must be r. Prints the register using its 32-bit W name.
x
Operand constraint must be r. Prints the register using its 64-bit X name.
b
Operand constraint must be w or x. Prints the register using its 8-bit B name.
h
Operand constraint must be w or x. Prints the register using its 16-bit H name.
s
Operand constraint must be w or x. Prints the register using its 32-bit S name.
d
Operand constraint must be w or x. Prints the register using its 64-bit D name.
q
Operand constraint must be w or x. Prints the register using its 128-bit Q name.
Example
// In AArch64 state, the 's' template modifiers cause these operands to be
// printed as S registers, instead of the default of V registers.
float add(float a, float b) {
float result;
__asm("fadd %s0, %s1, %s2"
: "=w" (result)
: "w" (a), "w" (b));
return result;
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.