home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / gcc-2.5.8-bin.lha / GNU / info / gcc.info-21 (.txt) < prev    next >
GNU Info File  |  1994-09-02  |  45KB  |  782 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.54 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License" and "Protect
  13. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  14. original, and provided that the entire resulting derived work is
  15. distributed under the terms of a permission notice identical to this
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that the sections entitled "GNU General Public
  19. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  20. permission notice, may be included in translations approved by the Free
  21. Software Foundation instead of in the original English.
  22. File: gcc.info,  Node: Condition Code,  Next: Costs,  Prev: Addressing Modes,  Up: Target Macros
  23. Condition Code Status
  24. =====================
  25.    The file `conditions.h' defines a variable `cc_status' to describe
  26. how the condition code was computed (in case the interpretation of the
  27. condition code depends on the instruction that it was set by).  This
  28. variable contains the RTL expressions on which the condition code is
  29. currently based, and several standard flags.
  30.    Sometimes additional machine-specific flags must be defined in the
  31. machine description header file.  It can also add additional
  32. machine-specific information by defining `CC_STATUS_MDEP'.
  33. `CC_STATUS_MDEP'
  34.      C code for a data type which is used for declaring the `mdep'
  35.      component of `cc_status'.  It defaults to `int'.
  36.      This macro is not used on machines that do not use `cc0'.
  37. `CC_STATUS_MDEP_INIT'
  38.      A C expression to initialize the `mdep' field to "empty".  The
  39.      default definition does nothing, since most machines don't use the
  40.      field anyway.  If you want to use the field, you should probably
  41.      define this macro to initialize it.
  42.      This macro is not used on machines that do not use `cc0'.
  43. `NOTICE_UPDATE_CC (EXP, INSN)'
  44.      A C compound statement to set the components of `cc_status'
  45.      appropriately for an insn INSN whose body is EXP.  It is this
  46.      macro's responsibility to recognize insns that set the condition
  47.      code as a byproduct of other activity as well as those that
  48.      explicitly set `(cc0)'.
  49.      This macro is not used on machines that do not use `cc0'.
  50.      If there are insns that do not set the condition code but do alter
  51.      other machine registers, this macro must check to see whether they
  52.      invalidate the expressions that the condition code is recorded as
  53.      reflecting.  For example, on the 68000, insns that store in address
  54.      registers do not set the condition code, which means that usually
  55.      `NOTICE_UPDATE_CC' can leave `cc_status' unaltered for such insns.
  56.      But suppose that the previous insn set the condition code based
  57.      on location `a4@(102)' and the current insn stores a new value in
  58.      `a4'.  Although the condition code is not changed by this, it will
  59.      no longer be true that it reflects the contents of `a4@(102)'.
  60.      Therefore, `NOTICE_UPDATE_CC' must alter `cc_status' in this case
  61.      to say that nothing is known about the condition code value.
  62.      The definition of `NOTICE_UPDATE_CC' must be prepared to deal with
  63.      the results of peephole optimization: insns whose patterns are
  64.      `parallel' RTXs containing various `reg', `mem' or constants which
  65.      are just the operands.  The RTL structure of these insns is not
  66.      sufficient to indicate what the insns actually do.  What
  67.      `NOTICE_UPDATE_CC' should do when it sees one is just to run
  68.      `CC_STATUS_INIT'.
  69.      A possible definition of `NOTICE_UPDATE_CC' is to call a function
  70.      that looks at an attribute (*note Insn Attributes::.) named, for
  71.      example, `cc'.  This avoids having detailed information about
  72.      patterns in two places, the `md' file and in `NOTICE_UPDATE_CC'.
  73. `EXTRA_CC_MODES'
  74.      A list of names to be used for additional modes for condition code
  75.      values in registers (*note Jump Patterns::.).  These names are
  76.      added to `enum machine_mode' and all have class `MODE_CC'.  By
  77.      convention, they should start with `CC' and end with `mode'.
  78.      You should only define this macro if your machine does not use
  79.      `cc0' and only if additional modes are required.
  80. `EXTRA_CC_NAMES'
  81.      A list of C strings giving the names for the modes listed in
  82.      `EXTRA_CC_MODES'.  For example, the Sparc defines this macro and
  83.      `EXTRA_CC_MODES' as
  84.           #define EXTRA_CC_MODES CC_NOOVmode, CCFPmode, CCFPEmode
  85.           #define EXTRA_CC_NAMES "CC_NOOV", "CCFP", "CCFPE"
  86.      This macro is not required if `EXTRA_CC_MODES' is not defined.
  87. `SELECT_CC_MODE (OP, X, Y)'
  88.      Returns a mode from class `MODE_CC' to be used when comparison
  89.      operation code OP is applied to rtx X and Y.  For example, on the
  90.      Sparc, `SELECT_CC_MODE' is defined as (see *note Jump Patterns::.
  91.      for a description of the reason for this definition)
  92.           #define SELECT_CC_MODE(OP,X,Y) \
  93.             (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT          \
  94.              ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode)    \
  95.              : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS    \
  96.                  || GET_CODE (X) == NEG) \
  97.                 ? CC_NOOVmode : CCmode))
  98.      You need not define this macro if `EXTRA_CC_MODES' is not defined.
  99. `CANONICALIZE_COMPARISON (CODE, OP0, OP1)'
  100.      One some machines not all possible comparisons are defined, but
  101.      you can convert an invalid comparison into a valid one.  For
  102.      example, the Alpha does not have a `GT' comparison, but you can
  103.      use an `LT' comparison instead and swap the order of the operands.
  104.      On such machines, define this macro to be a C statement to do any
  105.      required conversions.  CODE is the initial comparison code and OP0
  106.      and OP1 are the left and right operands of the comparison,
  107.      respectively.  You should modify CODE, OP0, and OP1 as required.
  108.      GNU CC will not assume that the comparison resulting from this
  109.      macro is valid but will see if the resulting insn matches a
  110.      pattern in the `md' file.
  111.      You need not define this macro if it would never change the
  112.      comparison code or operands.
  113. `REVERSIBLE_CC_MODE (MODE)'
  114.      A C expression whose value is one if it is always safe to reverse a
  115.      comparison whose mode is MODE.  If `SELECT_CC_MODE' can ever
  116.      return MODE for a floating-point inequality comparison, then
  117.      `REVERSIBLE_CC_MODE (MODE)' must be zero.
  118.      You need not define this macro if it would always returns zero or
  119.      if the floating-point format is anything other than
  120.      `IEEE_FLOAT_FORMAT'.  For example, here is the definition used on
  121.      the Sparc, where floating-point inequality comparisons are always
  122.      given `CCFPEmode':
  123.           #define REVERSIBLE_CC_MODE(MODE)  ((MODE) != CCFPEmode)
  124. File: gcc.info,  Node: Costs,  Next: Sections,  Prev: Condition Code,  Up: Target Macros
  125. Describing Relative Costs of Operations
  126. =======================================
  127.    These macros let you describe the relative speed of various
  128. operations on the target machine.
  129. `CONST_COSTS (X, CODE, OUTER_CODE)'
  130.      A part of a C `switch' statement that describes the relative costs
  131.      of constant RTL expressions.  It must contain `case' labels for
  132.      expression codes `const_int', `const', `symbol_ref', `label_ref'
  133.      and `const_double'.  Each case must ultimately reach a `return'
  134.      statement to return the relative cost of the use of that kind of
  135.      constant value in an expression.  The cost may depend on the
  136.      precise value of the constant, which is available for