1 #ifndef INCLUDED_volk_8ic_x2_s32f_multiply_conjugate_32fc_a_H
2 #define INCLUDED_volk_8ic_x2_s32f_multiply_conjugate_32fc_a_H
17 static inline void volk_8ic_x2_s32f_multiply_conjugate_32fc_a_sse4_1(
lv_32fc_t* cVector,
const lv_8sc_t* aVector,
const lv_8sc_t* bVector,
const float scalar,
unsigned int num_points){
18 unsigned int number = 0;
19 const unsigned int quarterPoints = num_points / 4;
21 __m128i x, y, realz, imagz;
26 __m128i conjugateSign = _mm_set_epi16(-1, 1, -1, 1, -1, 1, -1, 1);
28 __m128 invScalar = _mm_set_ps1(1.0/scalar);
30 for(;number < quarterPoints; number++){
32 x = _mm_cvtepi8_epi16(_mm_loadl_epi64((__m128i*)a));
33 y = _mm_cvtepi8_epi16(_mm_loadl_epi64((__m128i*)b));
36 realz = _mm_madd_epi16(x,y);
39 y = _mm_sign_epi16(y, conjugateSign);
42 y = _mm_shufflehi_epi16(_mm_shufflelo_epi16(y, _MM_SHUFFLE(2,3,0,1) ), _MM_SHUFFLE(2,3,0,1));
45 imagz = _mm_madd_epi16(x,y);
48 ret = _mm_cvtepi32_ps(_mm_unpacklo_epi32(realz, imagz));
51 ret = _mm_mul_ps(ret, invScalar);
54 _mm_store_ps((
float*)c, ret);
58 ret = _mm_cvtepi32_ps(_mm_unpackhi_epi32(realz, imagz));
61 ret = _mm_mul_ps(ret, invScalar);
64 _mm_store_ps((
float*)c, ret);
71 number = quarterPoints * 4;
72 float* cFloatPtr = (
float*)&cVector[number];
75 for(; number < num_points; number++){
76 float aReal = (float)*a8Ptr++;
77 float aImag = (float)*a8Ptr++;
79 float bReal = (float)*b8Ptr++;
80 float bImag = (float)*b8Ptr++;
84 *cFloatPtr++ =
lv_creal(temp) / scalar;
85 *cFloatPtr++ =
lv_cimag(temp) / scalar;
90 #ifdef LV_HAVE_GENERIC
98 static inline void volk_8ic_x2_s32f_multiply_conjugate_32fc_generic(
lv_32fc_t* cVector,
const lv_8sc_t* aVector,
const lv_8sc_t* bVector,
const float scalar,
unsigned int num_points){
99 unsigned int number = 0;
100 float* cPtr = (
float*)cVector;
101 const float invScalar = 1.0 / scalar;
104 for(number = 0; number < num_points; number++){
105 float aReal = (float)*a8Ptr++;
106 float aImag = (float)*a8Ptr++;
108 float bReal = (float)*b8Ptr++;
109 float bImag = (float)*b8Ptr++;
113 *cPtr++ = (
lv_creal(temp) * invScalar);
114 *cPtr++ = (
lv_cimag(temp) * invScalar);
#define lv_cmake(r, i)
Definition: volk_complex.h:59
signed char int8_t
Definition: stdint.h:75
float complex lv_32fc_t
Definition: volk_complex.h:56
#define lv_creal(x)
Definition: volk_complex.h:76
char complex lv_8sc_t
Provide typedefs and operators for all complex types in C and C++.
Definition: volk_complex.h:52
#define lv_cimag(x)
Definition: volk_complex.h:78