Chapter 6. Extensions to the C Language Family
g
Any register, memory or immediate integer operand is allowed, except for registers that are not
general registers.
X
Any operand whatsoever is allowed.
,
,
, . . .
0
1
2
9
An operand that matches the specified operand number is allowed. If a digit is used together with
letters within the same alternative, the digit should come last.
This number is allowed to be more than a single digit. If multiple digits are encountered con-
secutively, they are interpreted as a single decimal integer. There is scant chance for ambiguity,
since to-date it has never been desirable that
operand 0. Should this be desired, one can use multiple alternatives instead.
This is called a matching constraint and what it really means is that the assembler has only a
single operand that fills two roles which
two input operands and an output operand, but on most CISC machines an add instruction really
has only two operands, one of them an input-output operand:
addl #35,r12
Matching constraints are used in these circumstances. More precisely, the two operands that
match must include one input-only operand and one output-only operand. Moreover, the digit
must be a smaller number than the number of the operand that uses it in the constraint.
p
An operand that is a valid memory address is allowed. This is for "load address" and "push
address" instructions.
in the constraint must be accompanied by
p
match_operand
mode of the memory reference for which the address would be valid.
other-letters
Other letters can be defined in machine-dependent fashion to stand for particular classes of reg-
isters or other arbitrary operand types.
data, address and floating point registers.
6.38.2. Multiple Alternative Constraints
Sometimes a single instruction has multiple alternative sets of possible operands. For example, on
the 68000, a logical-or instruction can combine register or an immediate value into memory, or it can
combine any kind of operand into a register; but it cannot combine one memory location into another.
These constraints are represented as multiple alternatives. An alternative can be described by a series
of letters for each operand. The overall constraint for an operand is made from the letters for this
operand from the first alternative, a comma, the letters for this operand from the second alternative, a
comma, and so on until the last alternative.
If all the operands fit any one alternative, the instruction is valid. Otherwise, for each alternative, the
compiler counts how many instructions must be added to copy the operands so that that alternative
applies. The alternative requiring the least copying is chosen. If two alternatives need the same amount
of copying, the one that comes first is chosen. These choices can be altered with the
. This predicate interprets the mode specified in the
be interpreted as matching either operand 1 or
10
distinguishes. For example, an add instruction uses
asm
address_operand
,
and
are defined on the 68000/68020 to stand for
d
a
f
as the predicate in the
as the
match_operand
and
characters:
?
!
163
Need help?
Do you have a question about the ENTERPRISE LINUX 3 - USING GCC and is the answer not in the manual?
Questions and answers