The XL C/C++ Advanced Edition V7.0 for Linux ships the Mathematical Acceleration Subsystem (MASS), a set of libraries of tuned mathematical intrinsic functions that provide improved performance over the corresponding libm.a library functions. The accuracy and exception handling might not be identical in MASS functions and libm.a functions.
The MASS libraries on Linux consist of a library of vector functions, described in Using the vector libraries. Compiling and linking a program with MASS describes how to compile and link a program that uses the MASS libraries.
The MASS libraries for Linux are a subset of the MASS libraries for AIX. On Linux, 32-bit and 64-bit objects must not be mixed in a single library, so two versions of the MASS library are provided: libmassvp4.a (32-bit) and libmassvp4_64.a (64-bit).
The single-precision and double-precision functions contained in the
vector libraries are summarized in Table 7. To provide the prototypes for the functions, include
massv.h in your source files. Note that in C and C++
applications, only call by reference is supported, even for scalar
arguments.
Table 7. MASS vector library functions
Double-precision function | Single-precision function | Description | Double-precision function prototype | Single-precision function prototype |
vrec | vsrec | Sets y[i] to the reciprocal of x[i], for i=0,..,*n-1 | void vrec (double y[], double x[], int *n); | void vsrec (float y[], float x[], int *n); |
vrsqrt | vsrsqrt | Sets y[i] to the reciprocal of the square root of x[i], for i=0,..,*n-1 | void vrsqrt (double y[], double x[], int *n); | void vsrsqrt (float y[], float x[], int *n); |
vsqrt | vssqrt | Sets y[i] to the square root of x[i], for i=0,..,*n-1 | void vsqrt (double y[], double x[], int *n); | void vssqrt (float y[], float x[], int *n); |
All the functions in the MASS vector libraries are consistent, in the sense that a given input value will always produce the same result, regardless of its position in the vector, and regardless of the vector length.
To compile an application that calls the routines in the MASS libraries, specify massvp4 (32-bit) or massvp4_64 (64-bit) on the -l linker option. For example, if the MASS libraries are installed in the default directory /usr/lib, you could specify one of the following:
xlc progc.c -o progf -lmassvp4 xlc progc.c -o progf -lmassvp4_64 -q64
The MASS functions must run in the round-to-nearest rounding mode
and with floating-point exception trapping disabled. (These are the
default compilation settings.)