Restrictions on inline assembly statements
This section describes the restrictions on the use of inline assembly statements.
The following restrictions are on the use of inline assembly statements:
- The assembler instructions must be self-contained within an
asmstatement. Theasmstatement can only be used to generate instructions. All connections to the rest of the program must be established through the output and input operand list. - Referencing an external symbol directly without going through the operand list is not supported.
- Assembler instructions requiring a pair of registers are not specifiable by any constraints, and are therefore not supported. For example, you cannot use the %f constraint for a long double operand.
- The shared register file between the floating-point scalar and the vector registers are not
modelled as shared in inline assembly statements. You must specify registers
f0-f31andv0-v31in the clobbers list. There is no combinedx0-x63. - Operand replacements (such as
%0,%1, and so on) can use an optionalxbefore the number or symbolic name to indicate that a vsx register reference must be used. For example, a vector operand%1allocated to registerv0is replaced with 0 (for use in VMX instructions). The same operand used as%x1in the assembly text is replaced with 32 (for use in VSX instructions). Note that this restriction applies only for architectures that support VSX architecture extension.