40 #ifndef INCLUDED_volk_16i_max_star_16i_a_H
41 #define INCLUDED_volk_16i_max_star_16i_a_H
48 #include <emmintrin.h>
49 #include <tmmintrin.h>
50 #include <xmmintrin.h>
55 const unsigned int num_bytes = num_points * 2;
57 short candidate = src0[0];
59 __m128i xmm0, xmm1, xmm3, xmm4, xmm5, xmm6;
65 int bound = num_bytes >> 4;
66 int leftovers = (num_bytes >> 1) & 7;
76 for (
i = 0;
i < bound; ++
i) {
95 for (
i = 0;
i < 8; ++
i) {
96 candidate = ((short)(candidate - cands[
i]) > 0) ? candidate : cands[
i];
99 for (
i = 0;
i < leftovers; ++
i) {
100 candidate = ((short)(candidate - src0[(bound << 3) +
i]) > 0)
102 : src0[(bound << 3) +
i];
105 target[0] = candidate;
111 #include <arm_neon.h>
116 const unsigned int eighth_points = num_points / 8;
119 int16x8_t diff, zeros;
120 uint16x8_t comp1, comp2;
121 zeros = vdupq_n_s16(0);
125 int16x8_t candidate_vec = vld1q_dup_s16(src0);
129 for (number = 0; number < eighth_points; ++number) {
130 input_vec = vld1q_s16(src0);
132 diff = vsubq_s16(candidate_vec, input_vec);
133 comp1 = vcgeq_s16(diff, zeros);
134 comp2 = vcltq_s16(diff, zeros);
136 tmpvec.val[0] = vandq_s16(candidate_vec, (int16x8_t)comp1);
137 tmpvec.val[1] = vandq_s16(input_vec, (int16x8_t)comp2);
139 candidate_vec = vaddq_s16(tmpvec.val[0], tmpvec.val[1]);
142 vst1q_s16(&candidate, candidate_vec);
144 for (number = 0; number < num_points % 8; number++) {
145 candidate = ((int16_t)(candidate - src0[number]) > 0) ? candidate : src0[number];
147 target[0] = candidate;
151 #ifdef LV_HAVE_GENERIC
156 const unsigned int num_bytes = num_points * 2;
160 int bound = num_bytes >> 1;
162 short candidate = src0[0];
163 for (
i = 1;
i < bound; ++
i) {
164 candidate = ((short)(candidate - src0[
i]) > 0) ? candidate : src0[
i];
166 target[0] = candidate;
FORCE_INLINE void _mm_store_si128(__m128i *p, __m128i a)
Definition: sse2neon.h:5937
FORCE_INLINE __m128i _mm_cmpeq_epi16(__m128i a, __m128i b)
Definition: sse2neon.h:3267
FORCE_INLINE __m128i _mm_setzero_si128()
Definition: sse2neon.h:5339
FORCE_INLINE __m128i _mm_and_si128(__m128i, __m128i)
Definition: sse2neon.h:3128
FORCE_INLINE __m128i _mm_add_epi16(__m128i a, __m128i b)
Definition: sse2neon.h:2969
FORCE_INLINE __m128i _mm_shuffle_epi8(__m128i a, __m128i b)
Definition: sse2neon.h:7069
FORCE_INLINE __m128i _mm_xor_si128(__m128i a, __m128i b)
Definition: sse2neon.h:6458
FORCE_INLINE __m128i _mm_load_si128(const __m128i *p)
Definition: sse2neon.h:4471
FORCE_INLINE __m128i _mm_cmpgt_epi16(__m128i a, __m128i b)
Definition: sse2neon.h:3367
int64x2_t __m128i
Definition: sse2neon.h:244
static void volk_16i_max_star_16i_neon(short *target, short *src0, unsigned int num_points)
Definition: volk_16i_max_star_16i.h:114
static void volk_16i_max_star_16i_a_ssse3(short *target, short *src0, unsigned int num_points)
Definition: volk_16i_max_star_16i.h:53
static void volk_16i_max_star_16i_generic(short *target, short *src0, unsigned int num_points)
Definition: volk_16i_max_star_16i.h:154
#define __VOLK_PREFETCH(addr)
Definition: volk_common.h:71
for i
Definition: volk_config_fixed.tmpl.h:13