mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-29 02:14:51 +00:00
Add AVX2 implementation
This commit is contained in:
parent
f9e4bdfa59
commit
927f4d6b21
@ -179,6 +179,73 @@ static inline void volk_gnsssdr_16ic_convert_32fc_a_axv(lv_32fc_t* outputVector,
|
||||
}
|
||||
#endif /* LV_HAVE_AVX */
|
||||
|
||||
#ifdef LV_HAVE_AVX2
|
||||
#include <immintrin.h>
|
||||
|
||||
static inline void volk_gnsssdr_16ic_convert_32fc_a_avx2(lv_32fc_t* outputVector, const lv_16sc_t* inputVector, unsigned int num_points)
|
||||
{
|
||||
const unsigned int avx_iters = num_points / 8;
|
||||
unsigned int number = 0;
|
||||
const int16_t* complexVectorPtr = (int16_t*)inputVector;
|
||||
float* outputVectorPtr = (float*)outputVector;
|
||||
__m256 outVal;
|
||||
__m256i outValInt;
|
||||
__m128i cplxValue;
|
||||
|
||||
for (number = 0; number < avx_iters; number++)
|
||||
{
|
||||
cplxValue = _mm_load_si128((__m128i*)complexVectorPtr);
|
||||
complexVectorPtr += 8;
|
||||
|
||||
outValInt = _mm256_cvtepi16_epi32(cplxValue);
|
||||
outVal = _mm256_cvtepi32_ps(outValInt);
|
||||
_mm256_store_ps((float*)outputVectorPtr, outVal);
|
||||
|
||||
outputVectorPtr += 8;
|
||||
}
|
||||
|
||||
number = avx_iters * 8;
|
||||
for (; number < num_points * 2; number++)
|
||||
{
|
||||
*outputVectorPtr++ = (float)*complexVectorPtr++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* LV_HAVE_AVX2 */
|
||||
|
||||
#ifdef LV_HAVE_AVX2
|
||||
#include <immintrin.h>
|
||||
|
||||
static inline void volk_gnsssdr_16ic_convert_32fc_u_avx2(lv_32fc_t* outputVector, const lv_16sc_t* inputVector, unsigned int num_points)
|
||||
{
|
||||
const unsigned int avx_iters = num_points / 8;
|
||||
unsigned int number = 0;
|
||||
const int16_t* complexVectorPtr = (int16_t*)inputVector;
|
||||
float* outputVectorPtr = (float*)outputVector;
|
||||
__m256 outVal;
|
||||
__m256i outValInt;
|
||||
__m128i cplxValue;
|
||||
|
||||
for (number = 0; number < avx_iters; number++)
|
||||
{
|
||||
cplxValue = _mm_loadu_si128((__m128i*)complexVectorPtr);
|
||||
complexVectorPtr += 8;
|
||||
|
||||
outValInt = _mm256_cvtepi16_epi32(cplxValue);
|
||||
outVal = _mm256_cvtepi32_ps(outValInt);
|
||||
_mm256_storeu_ps((float*)outputVectorPtr, outVal);
|
||||
|
||||
outputVectorPtr += 8;
|
||||
}
|
||||
|
||||
number = avx_iters * 8;
|
||||
for (; number < num_points * 2; number++)
|
||||
{
|
||||
*outputVectorPtr++ = (float)*complexVectorPtr++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* LV_HAVE_AVX2 */
|
||||
|
||||
#ifdef LV_HAVE_NEONV7
|
||||
#include <arm_neon.h>
|
||||
|
Loading…
Reference in New Issue
Block a user