mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-11-15 22:34:58 +00:00
some improvements
phase computation was correclty done in SSE implementation but not in NEON. Ask for aligned memory in NEON implementation. Some code cleaning
This commit is contained in:
parent
db321d1c2e
commit
4fcffa2bdd
@ -95,6 +95,8 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* out
|
|||||||
lv_16sc_t* _out = outVector;
|
lv_16sc_t* _out = outVector;
|
||||||
|
|
||||||
__m128 yl, yh, tmp1, tmp2, tmp3;
|
__m128 yl, yh, tmp1, tmp2, tmp3;
|
||||||
|
lv_16sc_t tmp16;
|
||||||
|
lv_32fc_t tmp32;
|
||||||
|
|
||||||
for(unsigned int number = 0; number < sse_iters; number++)
|
for(unsigned int number = 0; number < sse_iters; number++)
|
||||||
{
|
{
|
||||||
@ -146,9 +148,8 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* out
|
|||||||
}
|
}
|
||||||
|
|
||||||
_mm_storeu_ps((float*)two_phase_acc, two_phase_acc_reg);
|
_mm_storeu_ps((float*)two_phase_acc, two_phase_acc_reg);
|
||||||
(*phase) = lv_cmake(two_phase_acc[0], two_phase_acc[0]) * phase_inc;
|
(*phase) = lv_cmake(two_phase_acc[0], two_phase_acc[0]);
|
||||||
lv_16sc_t tmp16;
|
|
||||||
lv_32fc_t tmp32;
|
|
||||||
for (unsigned int i = sse_iters * 4; i < num_points; ++i)
|
for (unsigned int i = sse_iters * 4; i < num_points; ++i)
|
||||||
{
|
{
|
||||||
tmp16 = *_in++;
|
tmp16 = *_in++;
|
||||||
@ -182,6 +183,8 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* out
|
|||||||
lv_16sc_t* _out = outVector;
|
lv_16sc_t* _out = outVector;
|
||||||
|
|
||||||
__m128 yl, yh, tmp1, tmp2, tmp3;
|
__m128 yl, yh, tmp1, tmp2, tmp3;
|
||||||
|
lv_16sc_t tmp16;
|
||||||
|
lv_32fc_t tmp32;
|
||||||
|
|
||||||
for(unsigned int number = 0; number < sse_iters; number++)
|
for(unsigned int number = 0; number < sse_iters; number++)
|
||||||
{
|
{
|
||||||
@ -233,9 +236,8 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* out
|
|||||||
}
|
}
|
||||||
|
|
||||||
_mm_storeu_ps((float*)two_phase_acc, two_phase_acc_reg);
|
_mm_storeu_ps((float*)two_phase_acc, two_phase_acc_reg);
|
||||||
(*phase) = lv_cmake(two_phase_acc[0], two_phase_acc[0]) * phase_inc;
|
(*phase) = lv_cmake(two_phase_acc[0], two_phase_acc[0]);
|
||||||
lv_16sc_t tmp16;
|
|
||||||
lv_32fc_t tmp32;
|
|
||||||
for (unsigned int i = sse_iters * 4; i < num_points; ++i)
|
for (unsigned int i = sse_iters * 4; i < num_points; ++i)
|
||||||
{
|
{
|
||||||
tmp16 = *_in++;
|
tmp16 = *_in++;
|
||||||
@ -261,8 +263,8 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe
|
|||||||
lv_16sc_t* _out = outVector;
|
lv_16sc_t* _out = outVector;
|
||||||
|
|
||||||
lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc;
|
lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc;
|
||||||
float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) };
|
__VOLK_ATTR_ALIGNED(16) float32_t __phase4_real[4] = { lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4) };
|
||||||
float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) };
|
__VOLK_ATTR_ALIGNED(16) float32_t __phase4_imag[4] = { lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4), lv_cimag(___phase4) };
|
||||||
|
|
||||||
float32x4_t _phase4_real = vld1q_f32(__phase4_real);
|
float32x4_t _phase4_real = vld1q_f32(__phase4_real);
|
||||||
float32x4_t _phase4_imag = vld1q_f32(__phase4_imag);
|
float32x4_t _phase4_imag = vld1q_f32(__phase4_imag);
|
||||||
@ -271,8 +273,8 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe
|
|||||||
lv_32fc_t phase3 = phase2 * phase_inc;
|
lv_32fc_t phase3 = phase2 * phase_inc;
|
||||||
lv_32fc_t phase4 = phase3 * phase_inc;
|
lv_32fc_t phase4 = phase3 * phase_inc;
|
||||||
|
|
||||||
float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) };
|
__VOLK_ATTR_ALIGNED(16) float32_t __phase_real[4] = { lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4) };
|
||||||
float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) };
|
__VOLK_ATTR_ALIGNED(16) float32_t __phase_imag[4] = { lv_cimag((*phase)), lv_cimag(phase2), lv_cimag(phase3), lv_cimag(phase4) };
|
||||||
|
|
||||||
float32x4_t _phase_real = vld1q_f32(__phase_real);
|
float32x4_t _phase_real = vld1q_f32(__phase_real);
|
||||||
float32x4_t _phase_imag = vld1q_f32(__phase_imag);
|
float32x4_t _phase_imag = vld1q_f32(__phase_imag);
|
||||||
@ -339,7 +341,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe
|
|||||||
vst1q_f32((float32_t*)__phase_real, _phase_real);
|
vst1q_f32((float32_t*)__phase_real, _phase_real);
|
||||||
vst1q_f32((float32_t*)__phase_imag, _phase_imag);
|
vst1q_f32((float32_t*)__phase_imag, _phase_imag);
|
||||||
|
|
||||||
(*phase) = lv_cmake((float32_t)__phase_real[3], (float32_t)__phase_imag[3]) * phase_inc;
|
(*phase) = lv_cmake((float32_t)__phase_real[0], (float32_t)__phase_imag[0]);
|
||||||
}
|
}
|
||||||
for(i = 0; i < neon_iters % 4; ++i)
|
for(i = 0; i < neon_iters % 4; ++i)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user