28 #ifndef _AK_VECTORVALUERAMP_H_
29 #define _AK_VECTORVALUERAMP_H_
31 #include <AK/SoundEngine/Common/AkSimd.h>
39 AkForceInline
AKSIMD_V4F32 Setup( AkReal32 in_fStartValue, AkReal32 in_fStopValue, AkUInt32 in_uNumFrames )
41 const AkReal32 fIncrement = (in_fStopValue-in_fStartValue)/in_uNumFrames;
42 const AkReal32 f4xInc = 4.f*fIncrement;
43 vIncrement = AKSIMD_LOAD1_V4F32( f4xInc);
44 AK_ALIGN_SIMD( AkReal32 fVal[4] );
45 fVal[0] = in_fStartValue;
46 fVal[1] = fVal[0] + fIncrement;
47 fVal[2] = fVal[1] + fIncrement;
48 fVal[3] = fVal[2] + fIncrement;
49 vValueRamp = AKSIMD_LOAD_V4F32( fVal );
55 vValueRamp = AKSIMD_ADD_V4F32( vValueRamp, vIncrement );
65 #ifdef AKSIMD_V2F32_SUPPORTED
68 class CAkVectorValueRampV2
72 AkForceInline
AKSIMD_V2F32 Setup( AkReal32 in_fStartValue, AkReal32 in_fStopValue, AkUInt32 in_uNumFrames )
74 const AkReal32 fIncrement = (in_fStopValue-in_fStartValue)/in_uNumFrames;
75 const AkReal32 f2xInc = 2.f*fIncrement;
76 vIncrement = AKSIMD_SET_V2F32( f2xInc );
77 AKSIMD_BUILD_V2F32(
const AKSIMD_V2F32 vStartOffset, 0.f, fIncrement );
78 AKSIMD_V2F32 l_vValueRamp = AKSIMD_SET_V2F32( in_fStartValue );
79 l_vValueRamp = AKSIMD_ADD_V2F32( l_vValueRamp, vStartOffset );
80 vValueRamp = l_vValueRamp;
86 vValueRamp = AKSIMD_ADD_V2F32( vValueRamp, vIncrement );
99 #endif //_AK_VECTORVALUERAMP_H_