Product documentation
Abstract
This document provides C/C++ prototypes and descriptions for MASS SIMD and vector functions.
Content
/**********************************************************************/
/* C/C++ prototypes for the single-precision SPU MASS SIMD functions. */
/* Prototypes not already in simdmath.h are available in mass_simd.h. */
/**********************************************************************/
vector float acosf4 (vector float vx);
/* Computes the arc cosine of each element of vx. */
vector float acoshf4 (vector float vx);
/* Computes the arc hyperbolic cosine of each element of vx. */
vector float asinf4 (vector float vx);
/* Computes the arc sine of each element of vx. */
vector float asinhf4 (vector float vx);
/* Computes the arc hyperbolic sine of each element of vx. */
vector float atanf4 (vector float vx);
/* Computes the arc tangent of each element of vx. */
vector float atan2f4 (vector float vx, vector float vy);
/* Computes the arc tangent of each element of vy/vx. */
vector float atanhf4 (vector float vx);
/* Computes the arc hyperbolic tangent of each element of vx. */
vector float cbrtf4 (vector float vx);
/* Computes the cube root of each element of vx. */
vector float cosf4 (vector float vx);
/* Computes the cosine of each element of vx. */
vector float coshf4 (vector float vx);
/* Computes the hyperbolic cosine of each element of vx. */
vector float divf4 (vector float vx, vector float vy);
/* Computes the quotient vx/vy. */
vector float erff4 (vector float vx);
/* Computes the the error function of each element of vx. */
vector float erfcf4 (vector float vx);
/* Computes 1 - the error function for each element of vx. */
vector float expf4 (vector float vx);
/* Computes the exponential function of each element of vx. */
vector float expm1f4 (vector float vx);
/* Computes the exponential function - 1 for each element of vx. */
vector float hypotf4 (vector float vx, vector float vy);
/* Computes the square root of vx^2 + vy^2 */
vector float lgammaf4 (vector float vx);
/* Computes the natural logarithm of the gamma function of vx. */
vector float logf4 (vector float vx);
/* Computes the natural logarithm of each element of vx. */
vector float log10f4 (vector float vx);
/* Computes the base-10 logarithm of each element of vx. */
vector float log1pf4 (vector float vx);
/* Computes the natural logarithm of each element of vx + 1. */
vector float log2f4 (vector float vx);
/* Computes the base-2 logarithm of each element of vx. */
vector float powf4 (vector float vx, vector float vy);
/* Computes each element of vx raised to the power of the corresponding
element of vy. */
vector float qdrtf4 (vector float vx);
/* Computes the quad root of each element of vx. */
vector float rcbrtf4 (vector float vx);
/* Computes the reciprocal of the cube root of each element of vx. */
vector float recipf4 (vector float vx);
/* Computes the reciprocal of each element of vx. */
vector float rqdrtf4 (vector float vx);
/* Computes the reciprocal of the quad root of each element of vx. */
vector float rsqrtf4 (vector float vx);
/* Computes the reciprocal of the square root of each element of vx. */
vector float sinf4 (vector float vx);
/* Computes the sine of each element of vx. */
void sincosf4 (vector float vx,vector float *vs,vector float *vc);
/* Sets *vs to the sine of vx and *vc to the cosine of vx. */
vector float sinhf4 (vector float vx);
/* Computes the hyperbolic sine of each element of vx. */
vector float sqrtf4 (vector float vx);
/* Computes the square root of each element of vx. */
vector float tanf4 (vector float vx);
/* Computes the tangent of each element of vx. */
vector float tanhf4 (vector float vx);
/* Computes the hyperbolic tangent of each element of vx. */
/**********************************************************************/
/* C/C++ prototypes for the double-precision SPU MASS SIMD functions. */
/* Prototypes not already in simdmath.h are available in mass_simd.h. */
/**********************************************************************/
vector double acosd2 (vector double vx);
/* Computes the arc cosine of each element of vx. */
vector double acoshd2 (vector double vx);
/* Computes the arc hyperbolic cosine of each element of vx. */
vector double asind2 (vector double vx);
/* Computes the arc sine of each element of vx. */
vector double asinhd2 (vector double vx);
/* Computes the arc hyperbolic sine of each element of vx. */
vector double atand2 (vector double vx);
/* Computes the arc tangent of each element of vx. */
vector double atan2d2 (vector double vx, vector double vy);
/* Computes the arc tangent of each element of vy/vx. */
vector double atanhd2 (vector double vx);
/* Computes the arc hyperbolic tangent of each element of vx. */
vector double cbrtd2 (vector double vx);
/* Computes the cube root of each element of vx. */
vector double cosd2 (vector double vx);
/* Computes the cosine of each element of vx. */
vector double coshd2 (vector double vx);
/* Computes the hyperbolic cosine of each element of vx. */
vector double divd2 (vector double vx, vector double vy);
/* Computes the quotient vx/vy. */
vector double erfd2 (vector double vx);
/* Computes the the error function of each element of vx. */
vector double erfcd2 (vector double vx);
/* Computes 1 - the error function for each element of vx. */
vector double expd2 (vector double vx);
/* Computes the exponential function of each element of vx. */
vector double exp2d2 (vector double vx);
/* Computes 2 to the power of each element of vx. */
vector double expm1d2 (vector double vx);
/* Computes the exponential function - 1 for each element of vx. */
vector double hypotd2 (vector double vx, vector double vy);
/* Computes the square root of vx^2 + vy^2 */
vector double lgammad2 (vector double vx);
/* Computes the natural logarithm of the gamma function of vx. */
vector double logd2 (vector double vx);
/* Computes the natural logarithm of each element of vx. */
vector double log10d2 (vector double vx);
/* Computes the base-10 logarithm of each element of vx. */
vector double log1pd2 (vector double vx);
/* Computes the natural logarithm of each element of vx + 1. */
vector double log2d2 (vector double vx);
/* Computes the base-2 logarithm of each element of vx. */
vector double powd2 (vector double vx, vector double vy);
/* Computes each element of vx raised to the power of the corresponding
element of vy. */
vector double qdrtd2 (vector double vx);
/* Computes the quad root of each element of vx. */
vector double rcbrtd2 (vector double vx);
/* Computes the reciprocal of the cube root of each element of vx. */
vector double recipd2 (vector double vx);
/* Computes the reciprocal of each element of vx. */
vector double rqdrtd2 (vector double vx);
/* Computes the reciprocal of the quad root of each element of vx. */
vector double rsqrtd2 (vector double vx);
/* Computes the reciprocal of the square root of each element of vx. */
vector double sind2 (vector double vx);
/* Computes the sine of each element of vx. */
void sincosd2 (vector double vx,vector double *vs,vector double *vc);
/* Sets *vs to the sine of vx and *vc to the cosine of vx. */
vector double sinhd2 (vector double vx);
/* Computes the hyperbolic sine of each element of vx. */
vector double sqrtd2 (vector double vx);
/* Computes the square root of each element of vx. */
vector double tand2 (vector double vx);
/* Computes the tangent of each element of vx. */
vector double tanhd2 (vector double vx);
/* Computes the hyperbolic tangent of each element of vx. */
/************************************************************************/
/* C/C++ prototypes for the single-precision SPU MASS vector functions. */
/* Prototypes are available in massv.h. */
/************************************************************************/
void vsacos (float y[],float x[],int *n);
/* Sets y[i] to the arc cosine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsacosh (float y[],float x[],int *n);
/* Sets y[i] to the arc hyperbolic cosine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsasin (float y[],float x[],int *n);
/* Sets y[i] to the arc sine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsasinh (float y[],float x[],int *n);
/* Sets y[i] to the arc hyperbolic sine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsatan2 (float a[],float x[],float y[],int *n);
/* Sets y[i] to the arc tangent of y[i]/x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsatan (float y[],float x[],int *n);
/* Sets y[i] to the arc tangent of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsatanh (float y[],float x[],int *n);
/* Sets y[i] to the arc hyperbolic tangent of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vscbrt (float y[],float x[],int *n);
/* Sets y[i] to the cube root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vscos (float y[],float x[],int *n);
/* Sets y[i] to the cosine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vscosh (float y[],float x[],int *n);
/* Sets y[i] to the hyperbolic cosine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vscosisin (float y[],float x[],int *n);
/* sets y[2*i] to cos(x[i]) and y[2*i+1] to sin(x[i]), i=0,...,*n-1. */
/* y must have length 2(*n), n must be a multiple of 4. */
void vsdiv (float z[],float x[],float y[],int *n);
/* Sets y[i] to the quotient x[i]/y[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vserf (float y[],float x[],int *n);
/* Sets y[i] to the error function of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vserfc (float y[],float x[],int *n);
/* Sets y[i] to 1 - the error function of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsexp (float y[],float x[],int *n);
/* Sets y[i] to the exponential function of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsexpm1 (float y[],float x[],int *n);
/* Sets y[i] to the exponential function - 1 of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vshypot (float z[],float x[],float y[],int *n);
/* Sets y[i] to the square root of x[i]^2 + y[i]^2, i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vslgamma (float y[],float x[],int *n);
/* Sets y[i] to the natural logarithm of the gamma function of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vslog (float y[],float x[],int *n);
/* Sets y[i] to the atural logarithm of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vslog10 (float y[],float x[],int *n);
/* Sets y[i] to the base-10 logarithm of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vslog1p (float y[],float x[],int *n);
/* Sets y[i] to the logarithm of x[i]+1, i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vslog2 (float y[],float x[],int *n);
/* Sets y[i] to the base-2 logarithm of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vspow (float z[],float x[],float y[],int *n);
/* Sets z[i] to x[i] raised to the power y[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsqdrt (float y[],float x[],int *n);
/* Sets y[i] to the quad root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsrcbrt (float y[],float x[],int *n);
/* Sets y[i] to the reciprocal of the cube root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsrec (float y[],float x[],int *n);
/* Sets y[i] to the reciprocal of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsrqdrt (float y[],float x[],int *n);
/* Sets y[i] to the reciprocal of the quad root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsrsqrt (float y[],float x[],int *n);
/* Sets y[i] to the reciprocal of the square root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vssincos (float s[],float c[],float x[],int *n);
/* Sets s[i] to the sin(x[i]) and c[i] to cos(x[i]), i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vssin (float y[],float x[],int *n);
/* Sets y[i] to the sine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vssih (float y[],float x[],int *n);
/* Sets y[i] to the hyperbolic sine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vssqrt (float y[],float x[],int *n);
/* Sets y[i] to the square root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vstan (float y[],float x[],int *n);
/* Sets y[i] to the tangent of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vstanh (float y[],float x[],int *n);
/* Sets y[i] to the hyperbolic tangent of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
/************************************************************************/
/* C/C++ prototypes for the double-precision SPU MASS vector functions. */
/* Prototypes are available in massv.h. */
/************************************************************************/
void vacos (double y[],double x[],int *n);
/* Sets y[i] to the arc cosine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vacosh (double y[],double x[],int *n);
/* Sets y[i] to the arc hyperbolic cosine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vasin (double y[],double x[],int *n);
/* Sets y[i] to the arc sine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vasinh (double y[],double x[],int *n);
/* Sets y[i] to the arc hyperbolic sine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vatan2 (double a[],double x[],double y[],int *n);
/* Sets y[i] to the arc tangent of y[i]/x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vatan (double y[],double x[],int *n);
/* Sets y[i] to the arc tangent of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vatanh (double y[],double x[],int *n);
/* Sets y[i] to the arc hyperbolic tangent of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vcbrt (double y[],double x[],int *n);
/* Sets y[i] to the cube root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vcos (double y[],double x[],int *n);
/* Sets y[i] to the cosine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vcosh (double y[],double x[],int *n);
/* Sets y[i] to the hyperbolic cosine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vcosisin (double y[],double x[],int *n);
/* sets y[2*i] to cos(x[i]) and y[2*i+1] to sin(x[i]), i=0,...,*n-1. */
/* y must have length 2(*n), n must be a multiple of 4. */
void vdiv (double z[],double x[],double y[],int *n);
/* Sets y[i] to the quotient x[i]/y[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void verf (double y[],double x[],int *n);
/* Sets y[i] to the error function of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void verfc (double y[],double x[],int *n);
/* Sets y[i] to 1 - the error function of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vexp (double y[],double x[],int *n);
/* Sets y[i] to the exponential function of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vexp2 (double y[],double x[],int *n);
/* Sets y[i] to the exponential function of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vexpm1 (double y[],double x[],int *n);
/* Sets y[i] to the exponential function - 1 of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vhypot (double z[],double x[],double y[],int *n);
/* Sets y[i] to the square root of x[i]^2 + y[i]^2, i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vlgamma (double y[],double x[],int *n);
/* Sets y[i] to the natural logarithm of the gamma function of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vlog (double y[],double x[],int *n);
/* Sets y[i] to the atural logarithm of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vlog10 (double y[],double x[],int *n);
/* Sets y[i] to the base-10 logarithm of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vlog1p (double y[],double x[],int *n);
/* Sets y[i] to the logarithm of x[i]+1, i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vlog2 (double y[],double x[],int *n);
/* Sets y[i] to the base-2 logarithm of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vpow (double z[],double x[],double y[],int *n);
/* Sets z[i] to x[i] raised to the power y[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vqdrt (double y[],double x[],int *n);
/* Sets y[i] to the quad root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vrcbrt (double y[],double x[],int *n);
/* Sets y[i] to the reciprocal of the cube root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vrec (double y[],double x[],int *n);
/* Sets y[i] to the reciprocal of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vrqdrt (double y[],double x[],int *n);
/* Sets y[i] to the reciprocal of the quad root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vrsqrt (double y[],double x[],int *n);
/* Sets y[i] to the reciprocal of the square root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsincos (double s[],double c[],double x[],int *n);
/* Sets s[i] to the sin(x[i]) and c[i] to cos(x[i]), i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsin (double y[],double x[],int *n);
/* Sets y[i] to the sine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsih (double y[],double x[],int *n);
/* Sets y[i] to the hyperbolic sine of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vsqrt (double y[],double x[],int *n);
/* Sets y[i] to the square root of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vtan (double y[],double x[],int *n);
/* Sets y[i] to the tangent of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
void vtanh (double y[],double x[],int *n);
/* Sets y[i] to the hyperbolic tangent of x[i], i=0,...,*n-1. */
/* n must be a multiple of 4. */
/***************************************************************/
/* C/C++ prototypes for the integer SPU MASS vector functions. */
/* Prototypes are available in massv.h. */
/***************************************************************/
unsigned int vpopcnt4 (void *x, int *n);
/* Returns the total number of 1 bits in the concatenation of
the binary representation of x[i], for i=0,...,n-1. x is
treated as a vector of 4-byte integers. */
unsigned int vpopcnt8 (void *x, int *n);
/* Returns the total number of 1 bits in the concatenation of
the binary representation of x[i], for i=0,...,n-1. x is
treated as a vector of 8-byte integers. */
Original publication date
2007/3/30
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.