1 #ifndef INCLUDED_volk_8i_convert_16i_u_H
2 #define INCLUDED_volk_8i_convert_16i_u_H
17 static inline void volk_8i_convert_16i_u_sse4_1(
int16_t* outputVector,
const int8_t* inputVector,
unsigned int num_points){
18 unsigned int number = 0;
19 const unsigned int sixteenthPoints = num_points / 16;
21 const __m128i* inputVectorPtr = (
const __m128i*)inputVector;
22 __m128i* outputVectorPtr = (__m128i*)outputVector;
26 for(;number < sixteenthPoints; number++){
27 inputVal = _mm_loadu_si128(inputVectorPtr);
28 ret = _mm_cvtepi8_epi16(inputVal);
29 ret = _mm_slli_epi16(ret, 8);
30 _mm_storeu_si128(outputVectorPtr, ret);
34 inputVal = _mm_srli_si128(inputVal, 8);
35 ret = _mm_cvtepi8_epi16(inputVal);
36 ret = _mm_slli_epi16(ret, 8);
37 _mm_storeu_si128(outputVectorPtr, ret);
44 number = sixteenthPoints * 16;
45 for(; number < num_points; number++){
46 outputVector[number] = (
int16_t)(inputVector[number])*256;
51 #ifdef LV_HAVE_GENERIC
59 static inline void volk_8i_convert_16i_generic(
int16_t* outputVector,
const int8_t* inputVector,
unsigned int num_points){
60 int16_t* outputVectorPtr = outputVector;
61 const int8_t* inputVectorPtr = inputVector;
62 unsigned int number = 0;
64 for(number = 0; number < num_points; number++){
65 *outputVectorPtr++ = ((
int16_t)(*inputVectorPtr++)) * 256;
74 #ifndef INCLUDED_volk_8i_convert_16i_a_H
75 #define INCLUDED_volk_8i_convert_16i_a_H
81 #include <smmintrin.h>
89 static inline void volk_8i_convert_16i_a_sse4_1(
int16_t* outputVector,
const int8_t* inputVector,
unsigned int num_points){
90 unsigned int number = 0;
91 const unsigned int sixteenthPoints = num_points / 16;
93 const __m128i* inputVectorPtr = (
const __m128i*)inputVector;
94 __m128i* outputVectorPtr = (__m128i*)outputVector;
98 for(;number < sixteenthPoints; number++){
99 inputVal = _mm_load_si128(inputVectorPtr);
100 ret = _mm_cvtepi8_epi16(inputVal);
101 ret = _mm_slli_epi16(ret, 8);
102 _mm_store_si128(outputVectorPtr, ret);
106 inputVal = _mm_srli_si128(inputVal, 8);
107 ret = _mm_cvtepi8_epi16(inputVal);
108 ret = _mm_slli_epi16(ret, 8);
109 _mm_store_si128(outputVectorPtr, ret);
116 number = sixteenthPoints * 16;
117 for(; number < num_points; number++){
118 outputVector[number] = (
int16_t)(inputVector[number])*256;
123 #ifdef LV_HAVE_GENERIC
130 static inline void volk_8i_convert_16i_a_generic(
int16_t* outputVector,
const int8_t* inputVector,
unsigned int num_points){
131 int16_t* outputVectorPtr = outputVector;
132 const int8_t* inputVectorPtr = inputVector;
133 unsigned int number = 0;
135 for(number = 0; number < num_points; number++){
136 *outputVectorPtr++ = ((
int16_t)(*inputVectorPtr++)) * 256;
142 #include <arm_neon.h>
151 static inline void volk_8i_convert_16i_neon(
int16_t* outputVector,
const int8_t* inputVector,
unsigned int num_points){
152 int16_t* outputVectorPtr = outputVector;
153 const int8_t* inputVectorPtr = inputVector;
155 const unsigned int eighth_points = num_points / 8;
158 int16x8_t converted_vec;
163 for(number = 0; number < eighth_points; ++number) {
164 input_vec = vld1_s8(inputVectorPtr);
165 converted_vec = vmovl_s8(input_vec);
167 converted_vec = vshlq_n_s16(converted_vec, 8);
168 vst1q_s16( outputVectorPtr, converted_vec);
171 outputVectorPtr += 8;
174 for(number = eighth_points * 8; number < num_points; number++){
175 *outputVectorPtr++ = ((
int16_t)(*inputVectorPtr++)) * 256;
187 extern void volk_8i_convert_16i_a_orc_impl(
int16_t* outputVector,
const int8_t* inputVector,
unsigned int num_points);
188 static inline void volk_8i_convert_16i_u_orc(
int16_t* outputVector,
const int8_t* inputVector,
unsigned int num_points){
189 volk_8i_convert_16i_a_orc_impl(outputVector, inputVector, num_points);
signed short int16_t
Definition: stdint.h:76
signed char int8_t
Definition: stdint.h:75