home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
gnu
/
info
/
gcc.info-20
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-02-20
|
49KB
|
831 lines
This is Info file gcc.info, produced by Makeinfo-1.55 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Published by the Free Software Foundation 675 Massachusetts Avenue
Cambridge, MA 02139 USA
Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License" and "Protect
Your Freedom--Fight `Look And Feel'" are included exactly as in the
original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License" and "Protect Your Freedom--Fight `Look And Feel'", and this
permission notice, may be included in translations approved by the Free
Software Foundation instead of in the original English.
File: gcc.info, Node: Condition Code, Next: Costs, Prev: Addressing Modes, Up: Target Macros
Condition Code Status
=====================
The file `conditions.h' defines a variable `cc_status' to describe
how the condition code was computed (in case the interpretation of the
condition code depends on the instruction that it was set by). This
variable contains the RTL expressions on which the condition code is
currently based, and several standard flags.
Sometimes additional machine-specific flags must be defined in the
machine description header file. It can also add additional
machine-specific information by defining `CC_STATUS_MDEP'.
`CC_STATUS_MDEP'
C code for a data type which is used for declaring the `mdep'
component of `cc_status'. It defaults to `int'.
This macro is not used on machines that do not use `cc0'.
`CC_STATUS_MDEP_INIT'
A C expression to initialize the `mdep' field to "empty". The
default definition does nothing, since most machines don't use the
field anyway. If you want to use the field, you should probably
define this macro to initialize it.
This macro is not used on machines that do not use `cc0'.
`NOTICE_UPDATE_CC (EXP, INSN)'
A C compound statement to set the components of `cc_status'
appropriately for an insn INSN whose body is EXP. It is this
macro's responsibility to recognize insns that set the condition
code as a byproduct of other activity as well as those that
explicitly set `(cc0)'.
This macro is not used on machines that do not use `cc0'.
If there are insns that do not set the condition code but do alter
other machine registers, this macro must check to see whether they
invalidate the expressions that the condition code is recorded as
reflecting. For example, on the 68000, insns that store in address
registers do not set the condition code, which means that usually
`NOTICE_UPDATE_CC' can leave `cc_status' unaltered for such insns.
But suppose that the previous insn set the condition code based
on location `a4@(102)' and the current insn stores a new value in
`a4'. Although the condition code is not changed by this, it will
no longer be true that it reflects the contents of `a4@(102)'.
Therefore, `NOTICE_UPDATE_CC' must alter `cc_status' in this case
to say that nothing is known about the condition code value.
The definition of `NOTICE_UPDATE_CC' must be prepared to deal with
the results of peephole optimization: insns whose patterns are
`parallel' RTXs containing various `reg', `mem' or constants which
are just the operands. The RTL structure of these insns is not
sufficient to indicate what the insns actually do. What
`NOTICE_UPDATE_CC' should do when it sees one is just to run
`CC_STATUS_INIT'.
A possible definition of `NOTICE_UPDATE_CC' is to call a function
that looks at an attribute (*note Insn Attributes::.) named, for
example, `cc'. This avoids having detailed information about
patterns in two places, the `md' file and in `NOTICE_UPDATE_CC'.
`EXTRA_CC_MODES'
A list of names to be used for additional modes for condition code
values in registers (*note Jump Patterns::.). These names are
added to `enum machine_mode' and all have class `MODE_CC'. By
convention, they should start with `CC' and end with `mode'.
You should only define this macro if your machine does not use
`cc0' and only if additional modes are required.
`EXTRA_CC_NAMES'
A list of C strings giving the names for the modes listed in
`EXTRA_CC_MODES'. For example, the Sparc defines this macro and
`EXTRA_CC_MODES' as
#define EXTRA_CC_MODES CC_NOOVmode, CCFPmode
#define EXTRA_CC_NAMES "CC_NOOV", "CCFP"
This macro is not required if `EXTRA_CC_MODES' is not defined.
`SELECT_CC_MODE (OP, X, Y)'
Returns a mode from class `MODE_CC' to be used when comparison
operation code OP is applied to rtx X and Y. For example, on the
Sparc, `SELECT_CC_MODE' is defined as (see *note Jump Patterns::.
for a description of the reason for this definition)
#define SELECT_CC_MODE(OP,X,Y) \
(GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \
: ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \
|| GET_CODE (X) == NEG) \
? CC_NOOVmode : CCmode))
This macro is not required if `EXTRA_CC_MODES' is not defined.
File: gcc.info, Node: Costs, Next: Sections, Prev: Condition Code, Up: Target Macros
Describing Relative Costs of Operations
=======================================
These macros let you describe the relative speed of various
operations on the target machine.
`CONST_COSTS (X, CODE, OUTER_CODE)'
A part of a C `switch' statement that describes the relative costs
of constant RTL expressions. It must contain `case' labels for
expression codes `const_int', `const', `symbol_ref', `label_ref'
and `const_double'. Each case must ultimately reach a `return'
statement to return the relative cost of the use of that kind of
constant value in an expression. The cost may depend on the
precise value of the constant, which is available for examination
in X, and the rtx code of the expression in which it is contained,
found in OUTER_CODE.
CODE is the expression code--redundant, since it can be obtained
with `GET_CODE (X)'.
`RTX_COSTS (X, CODE, OUTER_CODE)'
Like `CONST_COSTS' but applies to nonconstant RTL expressions.
This can be used, for example, to indicate how costly a multiply
instruction is. In writing this macro, you can use the construct
`COSTS_N_INSNS (N)' to specify a cost equal to N fast
instructions. OUTER_CODE is the code of the expression in which X
is contained.
This macro is optional; do not define it if the default cost
assumptions are adequate for the target machine.
`ADDRESS_COST (ADDRESS)'
An expression giving the cost of an addressing mode that contains
ADDRESS. If not defined, the cost is computed from the ADDRESS
expression and the `CONST_COSTS' values.
For most CISC machines, the default cost is a good approximation
of the true cost of the addressing mode. However, on RISC
machines, all instructions normally have the same length and
execution time. Hence all addresses will have equal costs.
In cases where more than one form of an address is known, the form
with the lowest cost will be used. If multiple forms have the
same, lowest, cost, the one that is the most complex will be used.
For example, suppose an address that is equal to the sum of a
register and a constant is used twice in th