Sun Studio 12 Update 1: C++ User's Guide

A.2.110.1 -xarch Flags for SPARC

The following table gives the details for each of the -xarch keywords on SPARC platforms.

Table A–23 The -xarch Flags for SPARC Platforms

Flag  

Meaning 

generic

Uses the instruction set common to most processors. This is the default, and is equivalent to v8plus when compiling with —m32, and sparc with —m64.

generic64

Compile for good performance on most 64-bit platforms. (Solaris only). 

This option is equivalent to -m64 -xarch=generic and is provided for compatibility with earlier releases. Use -m64 to specify 64-bit compilation instead of -xarch=generic64.

native

Compile for good performance on this system. The compiler chooses the appropriate setting for the current system processor it is running on. 

native64

Compile for good performance on this system (Solaris only). This option is equivalent to -m64 -xarch=native and is provided for compatibility with earlier releases.

sparc

Compile for the SPARC-V9 ISA, but without the Visual Instruction Set (VIS), and without other implementation-specific ISA extensions. This option enables the compiler to generate code for good performance on the V9 ISA. 

sparcvis

Compile for SPARC-V9 plus the Visual Instruction Set (VIS) version 1.0, and with UltraSPARC extensions. This option enables the compiler to generate code for good performance on the UltraSPARC architecture. 

sparcvis2

Enables the compiler to generate object code for the UltraSPARC architecture, plus the Visual Instruction Set (VIS) version 2.0, and with UltraSPARC III extensions. 

sparcfmaf

Enables the compiler to use instructions from the SPARC-V9 instruction set, plus the UltraSPARC extensions, including the Visual Instruction Set (VIS) version 1.0, the UltraSPARC-III extensions, including the Visual Instruction Set (VIS) version 2.0, and the SPARC64 VI extensions for floating-point multiply-add. 

You must use -xarch=sparcfmaf in conjunction with fma=fused and some optimization level to get the compiler to attempt to find opportunities to use the multiply-add instructions automatically.

v7

(Obsolete)

Compile for the SPARC-V7 ISA. Current Solaris operating systems no longer support the SPARC V7 architecture, and programs compiled with this option run slower on current platforms. 

The default is -xarch=v8plus.

Examples: SPARCstation 1, SPARCstation 2. 

v8a

(Obsolete)

Compile for the V8a version of the SPARC-V8 ISA. By definition, V8a means the V8 ISA, but without the fsmuld instruction.

This option enables the compiler to generate code for good performance on the V8a ISA. 

Example: Any system based on the microSPARC I chip architecture 

v8

(Obsolete)

Compile for the SPARC-V8 ISA. Enables the compiler to generate code for good performance on the V8 architecture. Example: SPARCstation 10 

v8plus

Compile for the V8plus version of the SPARC-V9 ISA. By definition, V8plus means the V9 ISA, but limited to the 32–bit subset defined by the V8plus ISA specification, without the Visual Instruction Set (VIS), and without other implementation-specific ISA extensions.

  • This option enables the compiler to generate code for good performance on the V8plus ISA.

  • The resulting object code is in SPARC-V8+ ELF32 format and only executes in a Solaris UltraSPARC environment—it does not run on a V7 or V8 processor.

    Example: Any system based on the UltraSPARC chip architecture

v8plusa

Compile for the V8plusa version of the SPARC-V9 ISA. By definition, V8plusa means the V8plus architecture, plus the Visual Instruction Set (VIS) version 1.0, and with UltraSPARC extensions.

  • This option enables the compiler to generate code for good performance on the UltraSPARC architecture, but limited to the 32–bit subset defined by the V8plus specification.

  • The resulting object code is in SPARC-V8+ ELF32 format and only executes in a Solaris UltraSPARC environment—it does not run on a V8 processor.

    Example: Any system based on the UltraSPARC chip architecture

v8plusb

Compile for the V8plusb version of the SPARC-V8plus ISA with UltraSPARC III extensions. 

Enables the compiler to generate object code for the UltraSPARC architecture, plus the Visual Instruction Set (VIS) version 2.0, and with UltraSPARC III extensions. 

  • The resulting object code is in SPARC-V8+ ELF32 format and executes only in a Solaris UltraSPARC III environment.

  • Compiling with this option uses the best instruction set for good performance on the UltraSPARC III architecture.

v9

Is equivalent to -m64 -xarch=sparc. Legacy makefiles and scripts that use -xarch=v9 to obtain the 64-bit memory model need only use -m64.

v9a

Is equivalent to -m64 -xarch=sparcvis and is provided for compatibility with earlier releases.

v9b

Is equivalent to -m64 -xarch=sparcvis2 and is provided for compatibility with earlier releases.

Also note the following:

For any particular choice, the generated executable may run much more slowly on earlier architectures. Also, although quad-precision (long double) floating-point instructions are available in many of these instruction set architectures, the compiler does not use these instructions in the code it generates.