Sun Studio 12: C User's Guide

B.2.152 -xvector[=a]

Enable 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 B–41 The -xvector Flags




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. 


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.


This is deprecated, specify -xvector=lib instead.


This is deprecated, specify -xvector=none instead.

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

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. For a complete list of all compiler options that must be specified at both compile time and at link time, see Table A–2.