Vector Optimized Library of Kernels 3.1.0
Architecture-tuned implementations of math kernels
volk_32fc_s32fc_rotator2puppet_32fc.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2012, 2013, 2014 Free Software Foundation, Inc.
4 *
5 * This file is part of VOLK
6 *
7 * SPDX-License-Identifier: LGPL-3.0-or-later
8 */
9
10
11#ifndef INCLUDED_volk_32fc_s32fc_rotator2puppet_32fc_a_H
12#define INCLUDED_volk_32fc_s32fc_rotator2puppet_32fc_a_H
13
14
15#include <stdio.h>
17#include <volk/volk_complex.h>
18
19
20#ifdef LV_HAVE_GENERIC
21
23 const lv_32fc_t* inVector,
24 const lv_32fc_t* phase_inc,
25 unsigned int num_points)
26{
27 lv_32fc_t phase[1] = { lv_cmake(.3f, 0.95393f) };
28 (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
29 const lv_32fc_t phase_inc_n =
30 *phase_inc / hypotf(lv_creal(*phase_inc), lv_cimag(*phase_inc));
32 outVector, inVector, &phase_inc_n, phase, num_points);
33}
34
35#endif /* LV_HAVE_GENERIC */
36
37
38#ifdef LV_HAVE_NEON
39#include <arm_neon.h>
41
43 const lv_32fc_t* inVector,
44 const lv_32fc_t* phase_inc,
45 unsigned int num_points)
46{
47 lv_32fc_t phase[1] = { lv_cmake(.3f, 0.95393f) };
48 (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
49 const lv_32fc_t phase_inc_n =
50 *phase_inc / hypotf(lv_creal(*phase_inc), lv_cimag(*phase_inc));
52 outVector, inVector, &phase_inc_n, phase, num_points);
53}
54
55#endif /* LV_HAVE_NEON */
56
57
58#ifdef LV_HAVE_SSE4_1
59#include <smmintrin.h>
60
61static inline void
62volk_32fc_s32fc_rotator2puppet_32fc_a_sse4_1(lv_32fc_t* outVector,
63 const lv_32fc_t* inVector,
64 const lv_32fc_t* phase_inc,
65 unsigned int num_points)
66{
67 lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) };
68 (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
69 const lv_32fc_t phase_inc_n =
70 *phase_inc / hypotf(lv_creal(*phase_inc), lv_cimag(*phase_inc));
71 volk_32fc_s32fc_x2_rotator2_32fc_a_sse4_1(
72 outVector, inVector, &phase_inc_n, phase, num_points);
73}
74
75#endif /* LV_HAVE_SSE4_1 */
76
77
78#ifdef LV_HAVE_SSE4_1
79#include <smmintrin.h>
80static inline void
81volk_32fc_s32fc_rotator2puppet_32fc_u_sse4_1(lv_32fc_t* outVector,
82 const lv_32fc_t* inVector,
83 const lv_32fc_t* phase_inc,
84 unsigned int num_points)
85{
86 lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) };
87 (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
88 const lv_32fc_t phase_inc_n =
89 *phase_inc / hypotf(lv_creal(*phase_inc), lv_cimag(*phase_inc));
90 volk_32fc_s32fc_x2_rotator2_32fc_u_sse4_1(
91 outVector, inVector, &phase_inc_n, phase, num_points);
92}
93
94#endif /* LV_HAVE_SSE4_1 */
95
96
97#ifdef LV_HAVE_AVX
98#include <immintrin.h>
99
101 const lv_32fc_t* inVector,
102 const lv_32fc_t* phase_inc,
103 unsigned int num_points)
104{
105 lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) };
106 (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
107 const lv_32fc_t phase_inc_n =
108 *phase_inc / hypotf(lv_creal(*phase_inc), lv_cimag(*phase_inc));
110 outVector, inVector, &phase_inc_n, phase, num_points);
111}
112
113#endif /* LV_HAVE_AVX */
114
115
116#ifdef LV_HAVE_AVX
117#include <immintrin.h>
118
120 const lv_32fc_t* inVector,
121 const lv_32fc_t* phase_inc,
122 unsigned int num_points)
123{
124 lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) };
125 (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
126 const lv_32fc_t phase_inc_n =
127 *phase_inc / hypotf(lv_creal(*phase_inc), lv_cimag(*phase_inc));
129 outVector, inVector, &phase_inc_n, phase, num_points);
130}
131
132#endif /* LV_HAVE_AVX */
133
134#if LV_HAVE_AVX && LV_HAVE_FMA
135#include <immintrin.h>
136
137static inline void
138volk_32fc_s32fc_rotator2puppet_32fc_a_avx_fma(lv_32fc_t* outVector,
139 const lv_32fc_t* inVector,
140 const lv_32fc_t* phase_inc,
141 unsigned int num_points)
142{
143 lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) };
144 (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
145 const lv_32fc_t phase_inc_n =
146 *phase_inc / hypotf(lv_creal(*phase_inc), lv_cimag(*phase_inc));
147 volk_32fc_s32fc_x2_rotator2_32fc_a_avx_fma(
148 outVector, inVector, &phase_inc_n, phase, num_points);
149}
150
151#endif /* LV_HAVE_AVX && LV_HAVE_FMA*/
152
153
154#if LV_HAVE_AVX && LV_HAVE_FMA
155#include <immintrin.h>
156
157static inline void
158volk_32fc_s32fc_rotator2puppet_32fc_u_avx_fma(lv_32fc_t* outVector,
159 const lv_32fc_t* inVector,
160 const lv_32fc_t* phase_inc,
161 unsigned int num_points)
162{
163 lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) };
164 (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
165 const lv_32fc_t phase_inc_n =
166 *phase_inc / hypotf(lv_creal(*phase_inc), lv_cimag(*phase_inc));
167 volk_32fc_s32fc_x2_rotator2_32fc_u_avx_fma(
168 outVector, inVector, &phase_inc_n, phase, num_points);
169}
170
171#endif /* LV_HAVE_AVX && LV_HAVE_FMA*/
172
173#endif /* INCLUDED_volk_32fc_s32fc_rotator2puppet_32fc_a_H */