Go to the first, previous, next, last section, table of contents.

Compiler options

When you run GCC, you can use command-line options to choose machine-specific details. For information on all the GCC command-line options, see section `GNU CC Command Options' in Using GNU CC.

GCC options for architecture and code generation

Some special compiler command-line options are available for SPARClite; in addition, the machine-dependent options already present for SPARC in general continue to be available. Both kinds of options are described in section `SPARC Options' in Using GNU CC.

-msparclite
The SPARC configurations of GCC generate code for the common subset of the instruction set: the v7 variant of the SPARC architecture. `-msparclite' (which is on automatically for any of the SPARClite configurations) gives you SPARClite code. This adds the integer multiply (smul and umul, just as in SPARC v8), integer divide-step (divscc), and scan (scan) instructions which exist in SPARClite but not in SPARC v7. Using `-msparclite' when you run the compiler does not, however, give you floating point code that uses the entry points for US Software's GOFAST library.
-mv8
`-mv8' gives you SPARC v8 code. The only difference from v7 code is that the compiler emits the integer multiply (smul and umul) and integer divide (sdiv and udiv) instructions which exist in SPARC v8 but not in SPARC v7.
-mf930
Generate code specifically intended for the Fujitsu MB86930, a SPARClite chip without an FPU. This option is equivalent to the combination `-msparclite -mno-fpu'. `-mf930' is the default when the compiler is configured specifically for SPARClite.
-mf934
Generate code specifically for the Fujitsu MB86934, a SPARClite chip with an FPU. This option is equivalent to `-msparclite'.
-mflat
Does not use register windows in function calls.

The following command line options are available for both SPARClite and other SPARC configurations of the compiler. See section `SPARC Options' in Using GNU CC.

-mno-epilogue
-mepilogue
With `-mepilogue' (the default), the compiler always emits code for function exit at the end of each function. Any function exit in the middle of the function (such as a return statement in C) will generate a jump to the exit code at the end of the function. With `-mno-epilogue', the compiler tries to emit exit code inline at every function exit. The Cygnus Support compiler specialists recommend avoiding `-mno-epilogue'.

GCC options for floating point

When you run the compiler, you can specify whether to compile for hardware or software floating point configurations with these GCC command-line options:

-mfpu
-mhard-float
Generate output containing floating point instructions. This is the default.
-mflat
Use flat register windows.
-msoft-float
-mno-fpu
Generate output containing library calls for floating point. The SPARC configurations of `libgcc' include a collection of subroutines to implement these library calls. In particular, the SPARClite GCC configurations generate subroutine calls compatible with the US Software `goFast.a' floating point library, giving you the opportunity to use either the `libgcc' implementation or the US Software version. To use the US Software library, simply include `-lgoFast' on the GCC command line. To use the `libgcc' version, you need nothing special; GCC links with `libgcc' automatically after all other object files and libraries.

Floating point subroutines

Two kinds of floating point subroutines are useful with GCC:

  1. Software implementations of the basic functions (floating-point multiply, divide, add, subtract), for use when there is no hardware floating-point support. When you indicate that no hardware floating point is available (with either of the GCC options `-msoft-float' or `-mno-fpu'), the SPARClite configurations of GCC generate calls compatible with the U.S. Software GOFAST library. If you do not have this library, you can still use software floating point; `libgcc', the auxiliary library distributed with GCC, includes compatible--though slower--subroutines.
  2. General-purpose mathematical subroutines. The Developer's Kit from Cygnus Support includes an implementation of the standard C mathematical subroutine library. See section `Mathematical Functions' in The Cygnus C Math Library.


Go to the first, previous, next, last section, table of contents.