Vector Optimized Library of Kernels  3.0.0
Architecture-tuned implementations of math kernels
volk_8u_x3_encodepolar_8u_x2.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2015 Free Software Foundation, Inc.
4  *
5  * This file is part of VOLK
6  *
7  * SPDX-License-Identifier: LGPL-3.0-or-later
8  */
9 
65 #ifndef VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_U_H_
66 #define VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_U_H_
67 #include <stdio.h>
69 
70 static inline void interleave_frozen_and_info_bits(unsigned char* target,
71  const unsigned char* frozen_bit_mask,
72  const unsigned char* frozen_bits,
73  const unsigned char* info_bits,
74  const unsigned int frame_size)
75 {
76  unsigned int bit;
77  for (bit = 0; bit < frame_size; ++bit) {
78  *target++ = *frozen_bit_mask++ ? *frozen_bits++ : *info_bits++;
79  }
80 }
81 
82 #ifdef LV_HAVE_GENERIC
83 
84 static inline void
86  unsigned char* temp,
87  const unsigned char* frozen_bit_mask,
88  const unsigned char* frozen_bits,
89  const unsigned char* info_bits,
90  unsigned int frame_size)
91 {
92  // interleave
94  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
95  volk_8u_x2_encodeframepolar_8u_generic(frame, temp, frame_size);
96 }
97 #endif /* LV_HAVE_GENERIC */
98 
99 
100 #ifdef LV_HAVE_SSSE3
101 #include <tmmintrin.h>
102 
103 static inline void
105  unsigned char* temp,
106  const unsigned char* frozen_bit_mask,
107  const unsigned char* frozen_bits,
108  const unsigned char* info_bits,
109  unsigned int frame_size)
110 {
111  // interleave
113  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
114  volk_8u_x2_encodeframepolar_8u_u_ssse3(frame, temp, frame_size);
115 }
116 
117 #endif /* LV_HAVE_SSSE3 */
118 
119 #ifdef LV_HAVE_AVX2
120 #include <immintrin.h>
121 static inline void
122 volk_8u_x3_encodepolar_8u_x2_u_avx2(unsigned char* frame,
123  unsigned char* temp,
124  const unsigned char* frozen_bit_mask,
125  const unsigned char* frozen_bits,
126  const unsigned char* info_bits,
127  unsigned int frame_size)
128 {
130  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
131  volk_8u_x2_encodeframepolar_8u_u_avx2(frame, temp, frame_size);
132 }
133 #endif /* LV_HAVE_AVX2 */
134 
135 #endif /* VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_U_H_ */
136 
137 #ifndef VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_A_H_
138 #define VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_A_H_
139 
140 #ifdef LV_HAVE_SSSE3
141 #include <tmmintrin.h>
142 static inline void
144  unsigned char* temp,
145  const unsigned char* frozen_bit_mask,
146  const unsigned char* frozen_bits,
147  const unsigned char* info_bits,
148  unsigned int frame_size)
149 {
151  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
152  volk_8u_x2_encodeframepolar_8u_a_ssse3(frame, temp, frame_size);
153 }
154 #endif /* LV_HAVE_SSSE3 */
155 
156 #ifdef LV_HAVE_AVX2
157 #include <immintrin.h>
158 static inline void
159 volk_8u_x3_encodepolar_8u_x2_a_avx2(unsigned char* frame,
160  unsigned char* temp,
161  const unsigned char* frozen_bit_mask,
162  const unsigned char* frozen_bits,
163  const unsigned char* info_bits,
164  unsigned int frame_size)
165 {
167  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
168  volk_8u_x2_encodeframepolar_8u_a_avx2(frame, temp, frame_size);
169 }
170 #endif /* LV_HAVE_AVX2 */
171 
172 #endif /* VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_A_H_ */
static void volk_8u_x2_encodeframepolar_8u_a_ssse3(unsigned char *frame, unsigned char *temp, unsigned int frame_size)
Definition: volk_8u_x2_encodeframepolar_8u.h:611
static void volk_8u_x2_encodeframepolar_8u_generic(unsigned char *frame, unsigned char *temp, unsigned int frame_size)
Definition: volk_8u_x2_encodeframepolar_8u.h:52
static void volk_8u_x2_encodeframepolar_8u_u_ssse3(unsigned char *frame, unsigned char *temp, unsigned int frame_size)
Definition: volk_8u_x2_encodeframepolar_8u.h:76
static void volk_8u_x3_encodepolar_8u_x2_generic(unsigned char *frame, unsigned char *temp, const unsigned char *frozen_bit_mask, const unsigned char *frozen_bits, const unsigned char *info_bits, unsigned int frame_size)
Definition: volk_8u_x3_encodepolar_8u_x2.h:85
static void interleave_frozen_and_info_bits(unsigned char *target, const unsigned char *frozen_bit_mask, const unsigned char *frozen_bits, const unsigned char *info_bits, const unsigned int frame_size)
Definition: volk_8u_x3_encodepolar_8u_x2.h:70
static void volk_8u_x3_encodepolar_8u_x2_a_ssse3(unsigned char *frame, unsigned char *temp, const unsigned char *frozen_bit_mask, const unsigned char *frozen_bits, const unsigned char *info_bits, unsigned int frame_size)
Definition: volk_8u_x3_encodepolar_8u_x2.h:143
static void volk_8u_x3_encodepolar_8u_x2_u_ssse3(unsigned char *frame, unsigned char *temp, const unsigned char *frozen_bit_mask, const unsigned char *frozen_bits, const unsigned char *info_bits, unsigned int frame_size)
Definition: volk_8u_x3_encodepolar_8u_x2.h:104