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

A.2.187 -xvector[=a]

Enables automatic generation of calls to the vector library functions and/or the generation of the SIMD (Single Instruction Multiple Data) instructions. You must use default rounding mode by specifying -fround=nearest when you use this option.

a is the equivalent of the following:

Table A–52 The -xvector Flags

Value 

Meaning  

[no%]lib

(Solaris only) Does [not] enable the compiler to transform math library calls within loops into single calls to the equivalent vector math routines when such transformations are possible. This could result in a performance improvement for loops with large loop counts.

[no%]simd

Does [not] direct the compiler to use the native x86 SSE SIMD instructions to improve performance of certain loops. The compiler can only accept this switch if the target architecture supports SIMD instructions. For example, you must specify -xarch=amd64, -xarch=amd64a or -xarch=generic64. You must also specify an optimization level of -xO3 or above as well as -xdepend when you specify -xvector=simd.

yes

This option is deprecated, specify -xvector=lib instead.

no

This option is deprecated, specify -xvector=none instead.

A.2.187.1 Defaults

The default is -xvector=%none. If you specify -xvector, but do not provide a flag, the compiler assumes -xvector=lib.

Interactions

If you use -xvector on the command line without previously specifying -xdepend, -xvector triggers -xdepend. The -xvector option also raises the optimization level to -x03 if optimization is not specified or optimization is set lower than -x03.

The compiler includes the libmvec libraries in the load step.

If you compile and link with separate commands, be sure to use -xvector in the linking CC command. See 3.3.3 Compile-Time and Link-Time Options for a complete list of options that must be specified at both compile time and link time.