| Framework | vecLib |
| Declared in | vBasicOps.h vBigNum.h vForce.h vecLibTypes.h vectorOps.h vfp.h |
The vecLib framework contains nine C header files (not counting vecLib.h which merely includes the others). Two of them, vDSP.h and vDSP_translate.h, are covered in vDSP Library.
Three of the header files are Apple’s versions of well-known libraries which are described in detail in external references:
cblas.h and vblas.h are the interfaces to Apple’s implementations of BLAS. Documentation on the BLAS standard, including reference implementations, can be found on the web starting from the BLAS FAQ page at these URLs (verified live as of July 2005): http://www.netlib.org/blas/faq.html and http://www.netlib.org/blas/blast-forum/blast-forum.html
clapack.h is the interface to Apple’s implementation of LAPACK. Documentation of the LAPACK interfaces, including reference implementations, can be found on the web starting from the LAPACK FAQ page at this URL (verified live as of July 2005): http://netlib.org/lapack/faq.html
This document describes the functions declared in the remaining header files: vecLibTypes.h, vfp.h, vForce.h, vBasicOps.h, vectorOps.h, and vBigNum.h.
These files support the vector mathematical functions library (also called “vMathLib”), which runs on vector processing hardware (Altivec or SSE3) if available. This library abstracts the vector processing capability so that code written for it will execute appropriate instructions for the processor available at runtime.
The vecLibTypes.h header file defines a set of vector data types (vFloat, vUInt32, etc.), which represent 128-bit vectors containing values of type float, UInt32, etc. The vBasicOps.h and vfp.h headers make use of these types.
The type names all begin with the letter “v,” followed by a mnemonic for the scalar data type used for elements of the vector. For example, vUInt32, vSInt16, vFloat, etc.
vBasicOps.h declares a set of basic arithmetic and logical functions on 128-bit vectors, using the integer types from vecLibTypes.h.
The function names begin with “v,” followed by a mnemonic for the type of operation, e.g. “S” or “U” for signed or unsigned, then the width of the operation, then the name of the operation. For example, vS8Divide performs division of signed 8-bit values packed into 128-bit vectors.
vBasicOps.h declares a set of floating-point arithmetic, transcendental and trigonometric functions, on 128-bit vectors, using the floating-point types from vecLibTypes.h.
These functions are named with their customary mathematical names, prefixed with the letter “v”, and all except vtablelookup() have the suffix “f” to indicate that they work with single-precision floating-point data. For example, vcosf is the single-precision cosine function.
vForce.h declares a set of trigonometric and transcendental functions in terms of C arrays (double * or float *), which can be of any desired length. Internally, the C arrays are converted piecewise into collections of 128-bit vectors, if appropriate for the current architecture.
The functions declared in vForce.h are named with the customary mathematical names, but with the prefix “vv.” Each mathematical function is available in two variants: one for single-precision floating-point data and one for double-precision data. The single-precision forms have the suffix “f”, while the double-precision forms have no suffix. For example, vvcosf is the single-precision cosine function, while vvcos is the double-precision variant.
All of the vForce.h functions follow a common format:
The return type is void.
The first parameter points to an array to hold the results. (The only exceptions are vvsincosf() and vvsincos(), which have two result arrays pointed to by the first two parameters.)
One or more parameters point to operand arrays, the same length as the result array.
The last parameter is the array length.
vectorOps.h declares a set of vector and matrix BLAS functions on arrays of 128-bit vectors containing single-precision floating-point values. The arrays can be of any desired length, but the number of float elements must be a multiple of 4.
vBigNum.h provides arithmetic and logical operations on large integers, which may be 128, 256, 512, or 1024 bits in length. It defines types for these values, and internally processes them as collections of 128-bit vectors.
vBigNum.h defines its own set of data types to represent large integer quantities, such as vS128 for a signed, 128-bit integer or vU1024 for an unsigned, 1025-bit integer. The function names begin with the data type name, followed by the name of the operation. For example, vS512Add performs addition of two 128-bit signed integers.
The functions perform logical and arithmetic operations on scalar values that may be 128, 256, 512, or 1024 bits in width. These values are implemented as structures of one, two, four, or eight 128-bit vectors, and the operations execute on the available vector-processing hardware if possible.
The functions have names that are compatible with those in vBasicOps.h.
For information about membership in Apple’s developer program, go to this URL:
http://developer.apple.com/membership/
For information about the Velocity Engine, go to this URL:
http://developer.apple.com/hardwaredrivers/ve/index.html
For general technical support from Apple, go to this URL:
http://developer.apple.com/technicalsupport/index.html
vLL64Shift
vLL64Shift2
vLR64Shift
vLR64Shift2
vA64Shift
vA64Shift2
vA128Shift
vL64Rotate
vR64Rotate
vL64Rotate2
vR64Rotate2
vL128Rotate
vR128Rotate
vU64Add
vU64AddS
vS64Add
vS64AddS
vU128Add
vU128AddS
vS128Add
vS128AddS
vU64Sub
vU64SubS
vS64Sub
vS64SubS
vU128Sub
vU128SubS
vS128Sub
vS128SubS
vU8HalfMultiply
vS8HalfMultiply
vU16HalfMultiply
vS16HalfMultiply
vU32HalfMultiply
vS32HalfMultiply
vU64HalfMultiply
vS64HalfMultiply
vU128HalfMultiply
vS128HalfMultiply
vU32FullMulEven
vU32FullMulOdd
vS32FullMulEven
vS32FullMulOdd
vU64FullMulEven
vU64FullMulOdd
vS64FullMulEven
vS64FullMulOdd
vU8Divide
vS8Divide
vU16Divide
vS16Divide
vU32Divide
vS32Divide
vU64Divide
vS64Divide
vU128Divide
vS128Divide
vvrecf
vvrec
vvdivf
vvdiv
vvsqrtf
vvsqrt
vvrsqrtf
vvrsqrt
vvintf
vvint
vvnintf
vvnint
vvceilf
vvceil
vvfloorf
vvfloor
vvsinf
vvsin
vvcosf
vvcos
vvtanf
vvtan
vvasinf
vvasin
vvacosf
vvacos
vvatanf
vvatan
vvatan2f
vvatan2
vvsincosf
vvsincos
vvcosisinf
vvcosisin
vLL256Shift
vLR256Shift
vA256Shift
vLL512Shift
vLR512Shift
vA512Shift
vLL1024Shift
vLR1024Shift
vA1024Shift
vL256Rotate
vR256Rotate
vL512Rotate
vR512Rotate
vL1024Rotate
vR1024Rotate
vU256Add
vU256AddS
vS256Add
vS256AddS
vU512Add
vU512AddS
vS512Add
vS512AddS
vU1024Add
vU1024AddS
vS1024Add
vS1024AddS
vU256Sub
vU256SubS
vS256Sub
vS256SubS
vU512Sub
vU512SubS
vS512Sub
vS512SubS
vU1024Sub
vU1024SubS
vS1024Sub
vS1024SubS
vU256Neg
vS256Neg
vU512Neg
vS512Neg
vU1024Neg
vS1024Neg
vU256Mod
vS256Mod
vU512Mod
vS512Mod
vU1024Mod
vS1024Mod
vU256HalfMultiply
vS256HalfMultiply
vU512HalfMultiply
vS512HalfMultiply
vU1024HalfMultiply
vS1024HalfMultiply
vU128FullMultiply
vS128FullMultiply
vU256FullMultiply
vS256FullMultiply
vU512FullMultiply
vS512FullMultiply
vU256Divide
vS256Divide
vU512Divide
vS512Divide
vU1024Divide
vS1024Divide
vIsamax
vIsamin
vIsmax
vIsmin
vSasum
vSsum
vSaxpy
vSnaxpy
vScopy
vSdot
vSndot
vSnrm2
vSnorm2
vSrot
vSscal
vSswap
vSyax()
vSzaxpy()
1024-bit arithmetic shift.
extern void vA1024Shift( const vS1024 * a, UInt32 shiftAmount, vS1024 * result);
vBigNum.h128-bit arithmetic shift.
extern vUInt32 vA128Shift(vUInt32 vA, vUInt8 vShiftFactor);
vBasicOps.h256-bit arithmetic shift.
extern void vA256Shift( const vS256 * a, UInt32 shiftAmount, vS256 * result);
vBigNum.h