29 #ifndef __MATH_SIMD_ALTIVEC_H__
30 #define __MATH_SIMD_ALTIVEC_H__
43 #define ENABLE_SIMPLE_MATH
49 #define ENABLE_COMPARES
61 #define ENABLE_16ROUTINES
64 #define ENABLE_LOWER_TRIANGULAR
79 #define ENABLE_SOUND_ROUTINES
84 #define LIVE_VICARIOUSLY
109 #if defined(MACOS_X) && defined(__ppc__)
114 #ifdef ENABLE_SIMPLE_MATH
117 virtual void VPCALL Add(
float *dst,
const float *src0,
const float *src1,
const int count );
118 virtual void VPCALL Sub(
float *dst,
const float constant,
const float *src,
const int count );
119 virtual void VPCALL Sub(
float *dst,
const float *src0,
const float *src1,
const int count );
120 virtual void VPCALL Mul(
float *dst,
const float constant,
const float *src,
const int count);
121 virtual void VPCALL Mul(
float *dst,
const float *src0,
const float *src1,
const int count );
122 virtual void VPCALL Div(
float *dst,
const float constant,
const float *
divisor,
const int count );
123 virtual void VPCALL Div(
float *dst,
const float *src0,
const float *src1,
const int count );
124 virtual void VPCALL MulAdd(
float *dst,
const float constant,
const float *src,
const int count );
125 virtual void VPCALL MulAdd(
float *dst,
const float *src0,
const float *src1,
const int count );
126 virtual void VPCALL MulSub(
float *dst,
const float constant,
const float *src,
const int count );
127 virtual void VPCALL MulSub(
float *dst,
const float *src0,
const float *src1,
const int count );
139 virtual void VPCALL Dot(
float &
dot,
const float *src1,
const float *src2,
const int count );
142 #ifdef ENABLE_COMPARES
144 virtual void VPCALL CmpGT(
byte *dst,
const float *src0,
const float constant,
const int count );
145 virtual void VPCALL CmpGT(
byte *dst,
const byte bitNum,
const float *src0,
const float constant,
const int count );
146 virtual void VPCALL CmpGE(
byte *dst,
const float *src0,
const float constant,
const int count );
147 virtual void VPCALL CmpGE(
byte *dst,
const byte bitNum,
const float *src0,
const float constant,
const int count );
148 virtual void VPCALL CmpLT(
byte *dst,
const float *src0,
const float constant,
const int count );
149 virtual void VPCALL CmpLT(
byte *dst,
const byte bitNum,
const float *src0,
const float constant,
const int count );
150 virtual void VPCALL CmpLE(
byte *dst,
const float *src0,
const float constant,
const int count );
151 virtual void VPCALL CmpLE(
byte *dst,
const byte bitNum,
const float *src0,
const float constant,
const int count );
156 virtual void VPCALL MinMax(
float &
min,
float &
max,
const float *src,
const int count );
165 virtual void VPCALL Clamp(
float *dst,
const float *src,
const float min,
const float max,
const int count );
166 virtual void VPCALL ClampMin(
float *dst,
const float *src,
const float min,
const int count );
167 virtual void VPCALL ClampMax(
float *dst,
const float *src,
const float max,
const int count );
174 #ifdef ENABLE_16ROUTINES
176 virtual void VPCALL Zero16(
float *dst,
const int count );
178 virtual void VPCALL Copy16(
float *dst,
const float *src,
const int count );
179 virtual void VPCALL Add16(
float *dst,
const float *src1,
const float *src2,
const int count );
180 virtual void VPCALL Sub16(
float *dst,
const float *src1,
const float *src2,
const int count );
181 virtual void VPCALL Mul16(
float *dst,
const float *src1,
const float constant,
const int count );
182 virtual void VPCALL AddAssign16(
float *dst,
const float *src,
const int count );
183 virtual void VPCALL SubAssign16(
float *dst,
const float *src,
const int count );
184 virtual void VPCALL MulAssign16(
float *dst,
const float constant,
const int count );
199 #ifdef ENABLE_LOWER_TRIANGULAR
204 #ifdef LIVE_VICARIOUSLY
210 #ifdef LIVE_VICARIOUSLY
236 #ifdef ENABLE_SOUND_ROUTINES
238 virtual void VPCALL UpSamplePCMTo44kHz(
float *dest,
const short *pcm,
const int numSamples,
const int kHz,
const int numChannels );
239 virtual void VPCALL UpSampleOGGTo44kHz(
float *dest,
const float *
const *ogg,
const int numSamples,
const int kHz,
const int numChannels );
240 virtual void VPCALL MixSoundTwoSpeakerMono(
float *mixBuffer,
const float *samples,
const int numSamples,
const float lastV[2],
const float currentV[2] );
241 virtual void VPCALL MixSoundTwoSpeakerStereo(
float *mixBuffer,
const float *samples,
const int numSamples,
const float lastV[2],
const float currentV[2] );
242 virtual void VPCALL MixSoundSixSpeakerMono(
float *mixBuffer,
const float *samples,
const int numSamples,
const float lastV[6],
const float currentV[6] );
243 virtual void VPCALL MixSoundSixSpeakerStereo(
float *mixBuffer,
const float *samples,
const int numSamples,
const float lastV[6],
const float currentV[6] );
virtual void VPCALL MatX_LowerTriangularSolve(const idMatX &L, float *x, const float *b, const int n, int skip=0)
virtual void VPCALL CreateSpecularTextureCoords(idVec4 *texCoords, const idVec3 &lightOrigin, const idVec3 &viewOrigin, const idDrawVert *verts, const int numVerts, const int *indexes, const int numIndexes)
virtual void VPCALL TransformVerts(idDrawVert *verts, const int numVerts, const idJointMat *joints, const idVec4 *weights, const int *index, const int numWeights)
virtual void VPCALL AddAssign16(float *dst, const float *src, const int count)
virtual void VPCALL Dot(float *dst, const idVec3 &constant, const idVec3 *src, const int count)
virtual void VPCALL BlendJoints(idJointQuat *joints, const idJointQuat *blendJoints, const float lerp, const int *index, const int numJoints)
virtual void VPCALL MixedSoundToSamples(short *samples, const float *mixBuffer, const int numSamples)
virtual void VPCALL ClampMax(float *dst, const float *src, const float max, const int count)
virtual void VPCALL TracePointCull(byte *cullBits, byte &totalOr, const float radius, const idPlane *planes, const idDrawVert *verts, const int numVerts)
virtual void VPCALL Add(float *dst, const float constant, const float *src, const int count)
virtual void VPCALL CmpGE(byte *dst, const float *src0, const float constant, const int count)
virtual void VPCALL MixSoundTwoSpeakerStereo(float *mixBuffer, const float *samples, const int numSamples, const float lastV[2], const float currentV[2])
virtual void VPCALL MatX_LowerTriangularSolveTranspose(const idMatX &L, float *x, const float *b, const int n)
virtual void VPCALL Sub16(float *dst, const float *src1, const float *src2, const int count)
virtual void VPCALL ClampMin(float *dst, const float *src, const float min, const int count)
virtual void VPCALL DeriveUnsmoothedTangents(idDrawVert *verts, const dominantTri_s *dominantTris, const int numVerts)
virtual void VPCALL MulAssign16(float *dst, const float constant, const int count)
virtual void VPCALL MixSoundTwoSpeakerMono(float *mixBuffer, const float *samples, const int numSamples, const float lastV[2], const float currentV[2])
GLuint GLuint GLsizei count
virtual void VPCALL OverlayPointCull(byte *cullBits, idVec2 *texCoords, const idPlane *planes, const idDrawVert *verts, const int numVerts)
virtual void VPCALL Negate16(float *dst, const int count)
virtual void VPCALL DecalPointCull(byte *cullBits, const idPlane *planes, const idDrawVert *verts, const int numVerts)
virtual void VPCALL SubAssign16(float *dst, const float *src, const int count)
virtual void VPCALL CmpLE(byte *dst, const float *src0, const float constant, const int count)
virtual void VPCALL Div(float *dst, const float constant, const float *src, const int count)
virtual void VPCALL ConvertJointQuatsToJointMats(idJointMat *jointMats, const idJointQuat *jointQuats, const int numJoints)
virtual void VPCALL DeriveTriPlanes(idPlane *planes, const idDrawVert *verts, const int numVerts, const int *indexes, const int numIndexes)
virtual bool VPCALL MatX_LDLTFactor(idMatX &mat, idVecX &invDiag, const int n)
virtual void VPCALL MulSub(float *dst, const float constant, const float *src, const int count)
virtual void VPCALL MixSoundSixSpeakerStereo(float *mixBuffer, const float *samples, const int numSamples, const float lastV[6], const float currentV[6])
virtual void VPCALL MixSoundSixSpeakerMono(float *mixBuffer, const float *samples, const int numSamples, const float lastV[6], const float currentV[6])
virtual void VPCALL CreateTextureSpaceLightVectors(idVec3 *lightVectors, const idVec3 &lightOrigin, const idDrawVert *verts, const int numVerts, const int *indexes, const int numIndexes)
virtual void VPCALL UpSamplePCMTo44kHz(float *dest, const short *pcm, const int numSamples, const int kHz, const int numChannels)
virtual void VPCALL DeriveTangents(idPlane *planes, idDrawVert *verts, const int numVerts, const int *indexes, const int numIndexes)
virtual void VPCALL Mul16(float *dst, const float *src1, const float constant, const int count)
virtual int VPCALL CreateShadowCache(idVec4 *vertexCache, int *vertRemap, const idVec3 &lightOrigin, const idDrawVert *verts, const int numVerts)
virtual void VPCALL Zero16(float *dst, const int count)
virtual void VPCALL Mul(float *dst, const float constant, const float *src, const int count)
virtual void VPCALL NormalizeTangents(idDrawVert *verts, const int numVerts)
idVertexCache vertexCache
virtual void VPCALL Clamp(float *dst, const float *src, const float min, const float max, const int count)
virtual void VPCALL UntransformJoints(idJointMat *jointMats, const int *parents, const int firstJoint, const int lastJoint)
float dot(float a[], float b[])
virtual int VPCALL CreateVertexProgramShadowCache(idVec4 *vertexCache, const idDrawVert *verts, const int numVerts)
virtual void VPCALL ConvertJointMatsToJointQuats(idJointQuat *jointQuats, const idJointMat *jointMats, const int numJoints)
virtual void VPCALL MulAdd(float *dst, const float constant, const float *src, const int count)
virtual void VPCALL MinMax(float &min, float &max, const float *src, const int count)
virtual void VPCALL Copy16(float *dst, const float *src, const int count)
virtual void VPCALL Sub(float *dst, const float constant, const float *src, const int count)
virtual void VPCALL TransformJoints(idJointMat *jointMats, const int *parents, const int firstJoint, const int lastJoint)
virtual void VPCALL CmpLT(byte *dst, const float *src0, const float constant, const int count)
virtual void VPCALL Add16(float *dst, const float *src1, const float *src2, const int count)
virtual void VPCALL UpSampleOGGTo44kHz(float *dest, const float *const *ogg, const int numSamples, const int kHz, const int numChannels)
virtual void VPCALL CmpGT(byte *dst, const float *src0, const float constant, const int count)
virtual const char *VPCALL GetName(void) const