Next | Prev | Up | Top | Contents | Index

Vector Intrinsic Functions

The MIPSpro 64-bit compilers support both single and double precision versions of the following vector instrinsic functions: asin(), acos(), atan(), cos(), exp(), log(), sin(), tan(), sqrt(). In C they are declared as follows:

/* single precision vector routines */
extern  __vacosf( float *x, float *y, int count, int stridex, int stridey );
extern  __vasinf( float *x, float *y, int count, int stridex, int stridey );
extern  __vatanf( float *x, float *y, int count, int stridex, int stridey );
extern  __vcosf(  float *x, float *y, int count, int stridex, int stridey );
extern  __vexpf(  float *x, float *y, int count, int stridex, int stridey );
extern  __vlogf(  float *x, float *y, int count, int stridex, int stridey );
extern  __vsinf(  float *x, float *y, int count, int stridex, int stridey );
extern  __vtanf(  float *x, float *y, int count, int stridex, int stridey );
/* double precision vector routines */
extern  __vacos( double *x, double *y, int count, int stridex, int stridey );
extern  __vasin( double *x, double *y, int count, int stridex, int stridey );
extern  __vatan( double *x, double *y, int count, int stridex, int stridey );
extern  __vcos(  double *x, double *y, int count, int stridex, int stridey );
extern  __vexp(  double *x, double *y, int count, int stridex, int stridey );
extern  __vlog(  double *x, double *y, int count, int stridex, int stridey );
extern  __vsin(  double *x, double *y, int count, int stridex, int stridey );
extern  __vtan(  double *x, double *y, int count, int stridex, int stridey )
The variables x and y are assumed to be pointers to non-overlapping arrays. Each routine is functionally equivalent to the following pseudo-code fragment:

     do i = 1, count-1
         y[0 + i*stridey] = func(x[0 + i*stridex])
     enddo
where func() is the scalar version of the vector intrinsic.


Manual vs. Automatic Invocation
Performance and Accuracy

Next | Prev | Up | Top | Contents | Index