| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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 section 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 these
macros:
REG_CLASS_FROM_LETTERRegister class constraints (usually lower case).
CONST_OK_FOR_LETTER_PImmediate constant constraints, for non-floating point constants of word size or smaller precision (usually upper case).
CONST_DOUBLE_OK_FOR_LETTER_PImmediate constant constraints, for all floating point constants and for constants of greater than word size precision (usually upper case).
EXTRA_CONSTRAINTSpecial 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, here is a summary of the machine-dependent constraints available on some particular machines.
fFloating-point register
FOne of the floating-point constants 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0 or 10.0
GFloating-point constant that would satisfy the constraint `F' if it were negated
IInteger that is valid as an immediate operand in a data processing instruction. That is, an integer in the range 0 to 255 rotated by a multiple of 2
JInteger in the range -4095 to 4095
KInteger that satisfies constraint `I' when inverted (ones complement)
LInteger that satisfies constraint `I' when negated (twos complement)
MInteger in the range 0 to 32
QA memory reference where the exact address is in a single register
(``m'' is preferable for asm statements)
RAn item in the constant pool
SA symbol in the text segment of the current file
lLocal register 0
bByte Pointer (`BP') register
q`Q' register
hSpecial purpose register
AFirst accumulator register
aOther accumulator register
fFloating point register
IConstant greater than 0, less than 0x100
JConstant greater than 0, less than 0x10000
KConstant whose high 24 bits are on (1)
L16 bit constant whose high 8 bits are on (1)
M32 bit constant whose high 16 bits are on (1)
N32 bit negative constant that fits in 8 bits
OThe constant 0x80000000 or, on the 29050, any 32 bit constant whose low 16 bits are 0.
P16 bit negative constant that fits in 8 bits
GHA floating point constant (in asm statements, use the machine
independent `E' or `F' instead)
bAddress base register
fFloating point register
h`MQ', `CTR', or `LINK' register
q`MQ' register
c`CTR' register
l`LINK' register
x`CR' register (condition register) number 0
y`CR' register (condition register)
z`FPMEM' stack memory for FPR-GPR transfers
ISigned 16 bit constant
JConstant whose low 16 bits are 0
KConstant whose high 16 bits are 0
LConstant suitable as a mask operand
MConstant larger than 31
NExact power of 2
OZero
PConstant whose negation is a signed 16 bit constant
GFloating point constant that can be loaded into a register with one instruction per word
QMemory operand that is an offset from a register (`m' is preferable
for asm statements)
RAIX TOC entry
SConstant suitable as a 64-bit mask operand
USystem V Release 4 small data area reference
q`a', b, c, or d register
A`a', or d register (for 64-bit ints)
fFloating point register
tFirst (top of stack) floating point register
uSecond floating point register
a`a' register
b`b' register
c`c' register
d`d' register
D`di' register
S`si' register
IConstant in range 0 to 31 (for 32 bit shifts)
JConstant in range 0 to 63 (for 64 bit shifts)
K`0xff'
L`0xffff'
M0, 1, 2, or 3 (shifts for lea instruction)
NConstant in range 0 to 255 (for out instruction)
GStandard 80387 floating point constant
fFloating point register (fp0 to fp3)
lLocal register (r0 to r15)
bGlobal register (g0 to g15)
dAny local or global register
IIntegers from 0 to 31
J0
KIntegers from -31 to 0
GFloating point 0
HFloating point 1
dGeneral-purpose integer register
fFloating-point register (if available)
h`Hi' register
l`Lo' register
x`Hi' or `Lo' register
yGeneral-purpose integer register
zFloating-point status register
ISigned 16 bit constant (for arithmetic instructions)
JZero
KZero-extended 16-bit constant (for logic instructions)
LConstant with low 16 bits zero (can be loaded with lui)
M32 bit constant which requires two instructions to load (a constant which is not `I', `K', or `L')
NNegative 16 bit constant
OExact power of two
PPositive 16 bit constant
GFloating point zero
QMemory reference that can be loaded with more than one instruction
(`m' is preferable for asm statements)
RMemory reference that can be loaded with one instruction
(`m' is preferable for asm statements)
SMemory reference in external OSF/rose PIC format
(`m' is preferable for asm statements)
aAddress register
dData register
f68881 floating-point register, if available
xSun FPA (floating-point) register, if available
yFirst 16 Sun FPA registers, if available
IInteger in the range 1 to 8
J16 bit signed number
KSigned number whose magnitude is greater than 0x80
LInteger in the range -8 to -1
MSigned number whose magnitude is greater than 0x100
GFloating point constant that is not a 68881 constant
HFloating point constant that can be used by Sun FPA
fFloating-point register that can hold 32 or 64 bit values.
eFloating-point register that can hold 64 or 128 bit values.
ISigned 13 bit constant
JZero
K32 bit constant with the low 12 bits clear (a constant that can be
loaded with the sethi instruction)
GFloating-point zero
HSigned 13 bit constant, sign-extended to 32 or 64 bits
QMemory reference that can be loaded with one instruction (`m' is
more appropriate for asm statements)
SConstant, or memory address
TMemory address aligned to an 8-byte boundary
UEven register
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Build Daemon user on October, 25 2005 using texi2html 1.76.