diff options
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/tm.texi | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index c566c291e7f..f3243b22c6f 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -49,6 +49,7 @@ through the macros defined in the @file{.h} file. * Floating Point:: Handling floating point for cross-compilers. * Mode Switching:: Insertion of mode-switching instructions. * Target Attributes:: Defining target-specific uses of @code{__attribute__}. +* MIPS Coprocessors:: MIPS coprocessor support and how to customize it. * Misc:: Everything else. @end menu @@ -8039,6 +8040,50 @@ attributes, @code{false} otherwise. By default, if a function has a target specific attribute attached to it, it will not be inlined. @end deftypefn +@node MIPS Coprocessors +@section Defining coprocessor specifics for MIPS targets. +@cindex MIPS coprocessor-definition macros + +The MIPS specification allows MIPS implementations to have as many as 4 +coprocessors, each with as many as 32 private registers. gcc supports +accessing these registers and transferring values between the registers +and memory using asm-ized variables. For example: + +@smallexample + register unsigned int cp0count asm ("c0r1"); + unsigned int d; + + d = cp0count + 3; +@end smallexample + +(``c0r1'' is the default name of register 1 in coprocessor 0; alternate +names may be added as described below, or the default names may be +overridden entirely in @code{SUBTARGET_CONDITIONAL_REGISTER_USAGE}.) + +Coprocessor registers are assumed to be epilogue-used; sets to them will +be preserved even if it does not appear that the register is used again +later in the function. + +Another note: according to the MIPS spec, coprocessor 1 (if present) is +the FPU. One accesses COP1 registers through standard mips +floating-point support; they are not included in this mechanism. + +There is one macro used in defining the MIPS coprocessor interface which +you may want to override in subtargets; it is described below. + +@table @code + +@item ALL_COP_ADDITIONAL_REGISTER_NAMES +@findex ALL_COP_ADDITIONAL_REGISTER_NAMES +A comma-separated list (with leading comma) of pairs describing the +alternate names of coprocessor registers. The format of each entry should be +@smallexample +@{ @var{alternatename}, @var{register_number}@} +@end smallexample +Default: empty. + +@end table + @node Misc @section Miscellaneous Parameters @cindex parameters, miscellaneous |