Vector Optimized Library of Kernels  2.4
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 GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
78 #ifndef VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_U_H_
79 #define VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_U_H_
80 #include <stdio.h>
82 
83 static inline void interleave_frozen_and_info_bits(unsigned char* target,
84  const unsigned char* frozen_bit_mask,
85  const unsigned char* frozen_bits,
86  const unsigned char* info_bits,
87  const unsigned int frame_size)
88 {
89  unsigned int bit;
90  for (bit = 0; bit < frame_size; ++bit) {
91  *target++ = *frozen_bit_mask++ ? *frozen_bits++ : *info_bits++;
92  }
93 }
94 
95 #ifdef LV_HAVE_GENERIC
96 
97 static inline void
99  unsigned char* temp,
100  const unsigned char* frozen_bit_mask,
101  const unsigned char* frozen_bits,
102  const unsigned char* info_bits,
103  unsigned int frame_size)
104 {
105  // interleave
107  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
108  volk_8u_x2_encodeframepolar_8u_generic(frame, temp, frame_size);
109 }
110 #endif /* LV_HAVE_GENERIC */
111 
112 
113 #ifdef LV_HAVE_SSSE3
114 #include <tmmintrin.h>
115 
116 static inline void
118  unsigned char* temp,
119  const unsigned char* frozen_bit_mask,
120  const unsigned char* frozen_bits,
121  const unsigned char* info_bits,
122  unsigned int frame_size)
123 {
124  // interleave
126  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
127  volk_8u_x2_encodeframepolar_8u_u_ssse3(frame, temp, frame_size);
128 }
129 
130 #endif /* LV_HAVE_SSSE3 */
131 
132 #ifdef LV_HAVE_AVX2
133 #include <immintrin.h>
134 static inline void
135 volk_8u_x3_encodepolar_8u_x2_u_avx2(unsigned char* frame,
136  unsigned char* temp,
137  const unsigned char* frozen_bit_mask,
138  const unsigned char* frozen_bits,
139  const unsigned char* info_bits,
140  unsigned int frame_size)
141 {
143  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
144  volk_8u_x2_encodeframepolar_8u_u_avx2(frame, temp, frame_size);
145 }
146 #endif /* LV_HAVE_AVX2 */
147 
148 #endif /* VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_U_H_ */
149 
150 #ifndef VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_A_H_
151 #define VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_A_H_
152 
153 #ifdef LV_HAVE_SSSE3
154 #include <tmmintrin.h>
155 static inline void
157  unsigned char* temp,
158  const unsigned char* frozen_bit_mask,
159  const unsigned char* frozen_bits,
160  const unsigned char* info_bits,
161  unsigned int frame_size)
162 {
164  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
165  volk_8u_x2_encodeframepolar_8u_a_ssse3(frame, temp, frame_size);
166 }
167 #endif /* LV_HAVE_SSSE3 */
168 
169 #ifdef LV_HAVE_AVX2
170 #include <immintrin.h>
171 static inline void
172 volk_8u_x3_encodepolar_8u_x2_a_avx2(unsigned char* frame,
173  unsigned char* temp,
174  const unsigned char* frozen_bit_mask,
175  const unsigned char* frozen_bits,
176  const unsigned char* info_bits,
177  unsigned int frame_size)
178 {
180  temp, frozen_bit_mask, frozen_bits, info_bits, frame_size);
181  volk_8u_x2_encodeframepolar_8u_a_avx2(frame, temp, frame_size);
182 }
183 #endif /* LV_HAVE_AVX2 */
184 
185 #endif /* VOLK_KERNELS_VOLK_VOLK_8U_X3_ENCODEPOLAR_8U_X2_A_H_ */
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:63
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:621
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:156
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:98
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:117
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:83
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:86