You copied the Doc URL to your clipboard.

Constraint codes common to AArch32 state and AArch64 state

The following constraint codes are common to both AArch32 state and AArch64 state.


A constant integer, or the address of a global variable or function.
A constant integer.


The immediate constraints only check that their operand is constant after optimizations have been applied. Therefore it is possible to write code that you can only compile at higher optimization levels. Arm recommends that you test your code at multiple optimization levels to ensure it compiles.


A memory reference. This constraint causes a general-purpose register to be allocated to hold the address of the value instead of the value itself. By default, this register is printed as the name of the register surrounded by square brackets, suitable for use as a memory operand. For example, [r4] or [x7]. In AArch32 state only, you can print the register without the surrounding square brackets by using the m template modifier. See Template modifiers for AArch32 state.


If the operand is a constant after optimizations have been performed, this constraint is equivalent to the i constraint. Otherwise, it is equivalent to the r or w constraints, depending on the type of the operand.


Arm recommends that you use more precise constraints where possible. The X constraint does not perform any of the range checking or register restrictions that the other constraints perform.