The following restrictions are on the use of inline assembly
statements:
- The assembler instructions must be self-contained within an asm statement.
The asm statement 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 can not use the %f constraint for
a _Decimal128 operand.
- The shared register file
between the floating point scalar and the vector registers on POWER7 are not modelled as shared
in inline assembly statements. You must specify registers f0-f31 and v0-v31 in
the clobbers list. There is no combined x0-x63.
- Operand replacements (such as %0, %1,
and so on) can use an optional x before the number
or symbolic name to indicate that a vsx register reference must be
used. For example, a vector operand %1 allocated
to register v0 is replaced with 0 (for use in VMX
instructions). The same operand used as %x1 in 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, such as POWER7).