Constraints for Particular MachinesContents|Index|Previous|Next Constraints
for particular machines Whenever possible, you should
use the general-purpose constraint letters in asm
arguments, since they will convey meaning more readily to people reading
your code. Failing that, use the constraint letters that usually have very
similar meanings across architectures. The most commonly used constraints
are m
and r
(for memory and general-purpose registers respectively; see Simple
constraints) and I,
usually the letter indicating the most common immediate-constant format.
For each machine architecture, the config/machine.h
file defines additional constraints. These constraints are used by the
compiler itself for instruction generation, as well as for asm
statements; therefore, some of the constraints are not particularly interesting
for asm.
The constraints are defined
through the following macros.
REG_CLASS_FROM_LETTER
Register class constraints
(usually lower case).
CONST_OK_FOR_LETTER_P
Immediate constant constraints,
for non-floating point constants of word size or smaller precision (usually
upper case).
CONST_DOUBLE_OK_FOR_LETTER_P
Immediate constant constraints,
for all floating point constants and for constants of greater than word
size precision (usually upper case).
EXTRA_CONSTRAINT
Special cases of registers
or memory. This macro is not required, and is only defined for some machines.
Inspecting these macro definitions
in the compiler source for your machine is the best way to be certain you
have the right constraints. However, see the following summary of the machine-dependent
constraints available on some particular machines.