1 #ifndef INCLUDED_volk_16i_convert_8i_u_H
2 #define INCLUDED_volk_16i_convert_8i_u_H
16 static inline void volk_16i_convert_8i_u_sse2(
int8_t* outputVector,
const int16_t* inputVector,
unsigned int num_points){
17 unsigned int number = 0;
18 const unsigned int sixteenthPoints = num_points / 16;
20 int8_t* outputVectorPtr = outputVector;
26 for(;number < sixteenthPoints; number++){
29 inputVal1 = _mm_loadu_si128((__m128i*)inputPtr); inputPtr += 8;
30 inputVal2 = _mm_loadu_si128((__m128i*)inputPtr); inputPtr += 8;
32 inputVal1 = _mm_srai_epi16(inputVal1, 8);
33 inputVal2 = _mm_srai_epi16(inputVal2, 8);
35 ret = _mm_packs_epi16(inputVal1, inputVal2);
37 _mm_storeu_si128((__m128i*)outputVectorPtr, ret);
39 outputVectorPtr += 16;
42 number = sixteenthPoints * 16;
43 for(; number < num_points; number++){
44 outputVector[number] =(
int8_t)(inputVector[number] >> 8);
49 #ifdef LV_HAVE_GENERIC
57 static inline void volk_16i_convert_8i_generic(
int8_t* outputVector,
const int16_t* inputVector,
unsigned int num_points){
58 int8_t* outputVectorPtr = outputVector;
59 const int16_t* inputVectorPtr = inputVector;
60 unsigned int number = 0;
62 for(number = 0; number < num_points; number++){
63 *outputVectorPtr++ = ((
int8_t)(*inputVectorPtr++ >> 8));
72 #ifndef INCLUDED_volk_16i_convert_8i_a_H
73 #define INCLUDED_volk_16i_convert_8i_a_H
79 #include <emmintrin.h>
86 static inline void volk_16i_convert_8i_a_sse2(
int8_t* outputVector,
const int16_t* inputVector,
unsigned int num_points){
87 unsigned int number = 0;
88 const unsigned int sixteenthPoints = num_points / 16;
90 int8_t* outputVectorPtr = outputVector;
96 for(;number < sixteenthPoints; number++){
99 inputVal1 = _mm_load_si128((__m128i*)inputPtr); inputPtr += 8;
100 inputVal2 = _mm_load_si128((__m128i*)inputPtr); inputPtr += 8;
102 inputVal1 = _mm_srai_epi16(inputVal1, 8);
103 inputVal2 = _mm_srai_epi16(inputVal2, 8);
105 ret = _mm_packs_epi16(inputVal1, inputVal2);
107 _mm_store_si128((__m128i*)outputVectorPtr, ret);
109 outputVectorPtr += 16;
112 number = sixteenthPoints * 16;
113 for(; number < num_points; number++){
114 outputVector[number] =(
int8_t)(inputVector[number] >> 8);
119 #ifdef LV_HAVE_GENERIC
126 static inline void volk_16i_convert_8i_a_generic(
int8_t* outputVector,
const int16_t* inputVector,
unsigned int num_points){
127 int8_t* outputVectorPtr = outputVector;
128 const int16_t* inputVectorPtr = inputVector;
129 unsigned int number = 0;
131 for(number = 0; number < num_points; number++){
132 *outputVectorPtr++ = ((
int8_t)(*inputVectorPtr++ >> 8));
signed short int16_t
Definition: stdint.h:76
signed char int8_t
Definition: stdint.h:75