When you run gcc, you can use command-line options to choose machine-specific details. For discussions of gcc command-line options, see GNU CC Command Options in Using GNU CC in GNUPro Compiler Tools.
GCC options for architecture and code generation for SPARC and SPARClite
The GNUPro Toolkit supports the machine-dependent options for SPARC in addition to special compiler command-line options available for Fujitsu SPARClite. Both kinds of options are described in SPARC Options in Using GNU CC in GNUPro Compiler Tools.
-g
The compiler debugging
option, -g,
is essential to see interspersed high-level source statements, since without
debugging information the assembler cannot tie most of the generated code
to lines of the original source file.
-mvh
-mvh gives you
SPARC version 8 code The only difference from version 7 code is that the
compiler emits the integer multiply (smul
and umul)
and integer divide (sdiv
and udiv)
instructions which exist in SPARC version 8 but not in SPARC version 7.
-mf930
Generate code
specifically intended for the SPARC MB86930, a Fujitsu SPARClite chip.
This option is equivalent to the combination, -msparclite
-mno-fpu. -mf930
is the default when the compiler is configured specifically for Fujitsu
SPARClite.
-mf934
Generate code
specifically intended for the SPARC MB86934, a Fujitsu SPARClite chip with
an FPU.
This option is equivalent to -msparclite.
-mflat
Does not register
windows in function calls.
-msparclite
The SPARC configurations
of gcc
generate code for the common subset of the instruction set: the version
7 variant of the SPARC architecture.
-msparclite (which is on automatically for any of the Fujitsu SPARClite configurations) gives you SPARClite code. This adds the integer multiply (smul and umul, just as in SPARC version 8), the integer divide-step (divscc), and scan (scan) instructions which exist in SPARClite but not in SPARC version 7.
Using -msparclite when you run the compiler does not, however, give you floating point code that uses the entry points for US Softwares GOFAST library.
GCC options for floating point for SPARC and SPARClite
The following command line options are available for both the SPARC and the Fujitsu SPARClite configurations of the compiler. See SPARC Options in Using GNU CC in GNUPro Compiler Tools.
-mfpu
-mhard-float
Generate output
containing floating point instructions as the default.
-msoft-float
-mno-sfpu
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 Fujitsu SPARClite 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, include the appropriate call 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 for SPARC and SPARClite
The following two kinds of floating point subroutines are useful with GCC.