| Line | Branch | Exec | Source |
|---|---|---|---|
| 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_rotatorpuppet_32fc_a_H | ||
| 12 | #define INCLUDED_volk_32fc_s32fc_rotatorpuppet_32fc_a_H | ||
| 13 | |||
| 14 | |||
| 15 | #include <stdio.h> | ||
| 16 | #include <volk/volk_32fc_s32fc_x2_rotator_32fc.h> | ||
| 17 | #include <volk/volk_complex.h> | ||
| 18 | |||
| 19 | |||
| 20 | #ifdef LV_HAVE_GENERIC | ||
| 21 | |||
| 22 | 2 | static inline void volk_32fc_s32fc_rotatorpuppet_32fc_generic(lv_32fc_t* outVector, | |
| 23 | const lv_32fc_t* inVector, | ||
| 24 | const lv_32fc_t phase_inc, | ||
| 25 | unsigned int num_points) | ||
| 26 | { | ||
| 27 | 2 | lv_32fc_t phase[1] = { lv_cmake(.3f, 0.95393f) }; | |
| 28 | 2 | (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase)); | |
| 29 | 2 | const lv_32fc_t phase_inc_n = | |
| 30 | 2 | phase_inc / hypotf(lv_creal(phase_inc), lv_cimag(phase_inc)); | |
| 31 | 2 | volk_32fc_s32fc_x2_rotator_32fc_generic( | |
| 32 | outVector, inVector, phase_inc_n, phase, num_points); | ||
| 33 | 2 | } | |
| 34 | |||
| 35 | #endif /* LV_HAVE_GENERIC */ | ||
| 36 | |||
| 37 | |||
| 38 | #ifdef LV_HAVE_NEON | ||
| 39 | #include <arm_neon.h> | ||
| 40 | #include <volk/volk_neon_intrinsics.h> | ||
| 41 | |||
| 42 | static inline void volk_32fc_s32fc_rotatorpuppet_32fc_neon(lv_32fc_t* outVector, | ||
| 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)); | ||
| 51 | volk_32fc_s32fc_x2_rotator_32fc_neon( | ||
| 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 | |||
| 61 | 2 | static inline void volk_32fc_s32fc_rotatorpuppet_32fc_a_sse4_1(lv_32fc_t* outVector, | |
| 62 | const lv_32fc_t* inVector, | ||
| 63 | const lv_32fc_t phase_inc, | ||
| 64 | unsigned int num_points) | ||
| 65 | { | ||
| 66 | 2 | lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) }; | |
| 67 | 2 | (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase)); | |
| 68 | 2 | const lv_32fc_t phase_inc_n = | |
| 69 | 2 | phase_inc / hypotf(lv_creal(phase_inc), lv_cimag(phase_inc)); | |
| 70 | 2 | volk_32fc_s32fc_x2_rotator_32fc_a_sse4_1( | |
| 71 | outVector, inVector, phase_inc_n, phase, num_points); | ||
| 72 | 2 | } | |
| 73 | |||
| 74 | #endif /* LV_HAVE_SSE4_1 */ | ||
| 75 | |||
| 76 | |||
| 77 | #ifdef LV_HAVE_SSE4_1 | ||
| 78 | #include <smmintrin.h> | ||
| 79 | 2 | static inline void volk_32fc_s32fc_rotatorpuppet_32fc_u_sse4_1(lv_32fc_t* outVector, | |
| 80 | const lv_32fc_t* inVector, | ||
| 81 | const lv_32fc_t phase_inc, | ||
| 82 | unsigned int num_points) | ||
| 83 | { | ||
| 84 | 2 | lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) }; | |
| 85 | 2 | (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase)); | |
| 86 | 2 | const lv_32fc_t phase_inc_n = | |
| 87 | 2 | phase_inc / hypotf(lv_creal(phase_inc), lv_cimag(phase_inc)); | |
| 88 | 2 | volk_32fc_s32fc_x2_rotator_32fc_u_sse4_1( | |
| 89 | outVector, inVector, phase_inc_n, phase, num_points); | ||
| 90 | 2 | } | |
| 91 | |||
| 92 | #endif /* LV_HAVE_SSE4_1 */ | ||
| 93 | |||
| 94 | |||
| 95 | #ifdef LV_HAVE_AVX | ||
| 96 | #include <immintrin.h> | ||
| 97 | |||
| 98 | 2 | static inline void volk_32fc_s32fc_rotatorpuppet_32fc_a_avx(lv_32fc_t* outVector, | |
| 99 | const lv_32fc_t* inVector, | ||
| 100 | const lv_32fc_t phase_inc, | ||
| 101 | unsigned int num_points) | ||
| 102 | { | ||
| 103 | 2 | lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) }; | |
| 104 | 2 | (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase)); | |
| 105 | 2 | const lv_32fc_t phase_inc_n = | |
| 106 | 2 | phase_inc / hypotf(lv_creal(phase_inc), lv_cimag(phase_inc)); | |
| 107 | 2 | volk_32fc_s32fc_x2_rotator_32fc_a_avx( | |
| 108 | outVector, inVector, phase_inc_n, phase, num_points); | ||
| 109 | 2 | } | |
| 110 | |||
| 111 | #endif /* LV_HAVE_AVX */ | ||
| 112 | |||
| 113 | |||
| 114 | #ifdef LV_HAVE_AVX | ||
| 115 | #include <immintrin.h> | ||
| 116 | |||
| 117 | 2 | static inline void volk_32fc_s32fc_rotatorpuppet_32fc_u_avx(lv_32fc_t* outVector, | |
| 118 | const lv_32fc_t* inVector, | ||
| 119 | const lv_32fc_t phase_inc, | ||
| 120 | unsigned int num_points) | ||
| 121 | { | ||
| 122 | 2 | lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) }; | |
| 123 | 2 | (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase)); | |
| 124 | 2 | const lv_32fc_t phase_inc_n = | |
| 125 | 2 | phase_inc / hypotf(lv_creal(phase_inc), lv_cimag(phase_inc)); | |
| 126 | 2 | volk_32fc_s32fc_x2_rotator_32fc_u_avx( | |
| 127 | outVector, inVector, phase_inc_n, phase, num_points); | ||
| 128 | 2 | } | |
| 129 | |||
| 130 | #endif /* LV_HAVE_AVX */ | ||
| 131 | |||
| 132 | #if LV_HAVE_AVX && LV_HAVE_FMA | ||
| 133 | #include <immintrin.h> | ||
| 134 | |||
| 135 | 2 | static inline void volk_32fc_s32fc_rotatorpuppet_32fc_a_avx_fma(lv_32fc_t* outVector, | |
| 136 | const lv_32fc_t* inVector, | ||
| 137 | const lv_32fc_t phase_inc, | ||
| 138 | unsigned int num_points) | ||
| 139 | { | ||
| 140 | 2 | lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) }; | |
| 141 | 2 | (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase)); | |
| 142 | 2 | const lv_32fc_t phase_inc_n = | |
| 143 | 2 | phase_inc / hypotf(lv_creal(phase_inc), lv_cimag(phase_inc)); | |
| 144 | 2 | volk_32fc_s32fc_x2_rotator_32fc_a_avx_fma( | |
| 145 | outVector, inVector, phase_inc_n, phase, num_points); | ||
| 146 | 2 | } | |
| 147 | |||
| 148 | #endif /* LV_HAVE_AVX && LV_HAVE_FMA*/ | ||
| 149 | |||
| 150 | |||
| 151 | #if LV_HAVE_AVX && LV_HAVE_FMA | ||
| 152 | #include <immintrin.h> | ||
| 153 | |||
| 154 | 2 | static inline void volk_32fc_s32fc_rotatorpuppet_32fc_u_avx_fma(lv_32fc_t* outVector, | |
| 155 | const lv_32fc_t* inVector, | ||
| 156 | const lv_32fc_t phase_inc, | ||
| 157 | unsigned int num_points) | ||
| 158 | { | ||
| 159 | 2 | lv_32fc_t phase[1] = { lv_cmake(.3f, .95393f) }; | |
| 160 | 2 | (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase)); | |
| 161 | 2 | const lv_32fc_t phase_inc_n = | |
| 162 | 2 | phase_inc / hypotf(lv_creal(phase_inc), lv_cimag(phase_inc)); | |
| 163 | 2 | volk_32fc_s32fc_x2_rotator_32fc_u_avx_fma( | |
| 164 | outVector, inVector, phase_inc_n, phase, num_points); | ||
| 165 | 2 | } | |
| 166 | |||
| 167 | #endif /* LV_HAVE_AVX && LV_HAVE_FMA*/ | ||
| 168 | |||
| 169 | #endif /* INCLUDED_volk_32fc_s32fc_rotatorpuppet_32fc_a_H */ | ||
| 170 |