chris@160
|
1 /**
|
chris@160
|
2 * Copyright (c) 2014, 2015, Enzien Audio Ltd.
|
chris@160
|
3 *
|
chris@160
|
4 * Permission to use, copy, modify, and/or distribute this software for any
|
chris@160
|
5 * purpose with or without fee is hereby granted, provided that the above
|
chris@160
|
6 * copyright notice and this permission notice appear in all copies.
|
chris@160
|
7 *
|
chris@160
|
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
chris@160
|
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
chris@160
|
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
chris@160
|
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
chris@160
|
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
chris@160
|
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
chris@160
|
14 * PERFORMANCE OF THIS SOFTWARE.
|
chris@160
|
15 */
|
chris@160
|
16
|
chris@160
|
17 #ifndef _SIGNAL_DEL1_H_
|
chris@160
|
18 #define _SIGNAL_DEL1_H_
|
chris@160
|
19
|
chris@160
|
20 #include "HvBase.h"
|
chris@160
|
21
|
chris@160
|
22 typedef struct SignalDel1 {
|
chris@160
|
23 hv_bufferf_t x;
|
chris@160
|
24 } SignalDel1;
|
chris@160
|
25
|
chris@160
|
26 hv_size_t sDel1_init(SignalDel1 *o);
|
chris@160
|
27
|
chris@160
|
28 void sDel1_onMessage(HvBase *_c, SignalDel1 *o, int letIn, const HvMessage *m);
|
chris@160
|
29
|
chris@160
|
30 static inline void __hv_del1_f(SignalDel1 *o, hv_bInf_t bIn0, hv_bOutf_t bOut) {
|
chris@160
|
31 #if HV_SIMD_AVX
|
chris@160
|
32 __m256 x = _mm256_permute_ps(bIn0, _MM_SHUFFLE(2,1,0,3)); // [3 0 1 2 7 4 5 6]
|
chris@160
|
33 __m256 n = _mm256_permute2f128_ps(o->x,x,0x1); // [h e f g 3 0 1 2]
|
chris@160
|
34 *bOut = _mm256_blend_ps(x, n, 0x11); // [g 0 1 2 3 4 5 6]
|
chris@160
|
35 o->x = x;
|
chris@160
|
36 #elif HV_SIMD_SSE
|
chris@160
|
37 __m128 n = _mm_blend_ps(o->x, bIn0, 0x7);
|
chris@160
|
38 *bOut = _mm_shuffle_ps(n, n, _MM_SHUFFLE(2,1,0,3));
|
chris@160
|
39 o->x = bIn0;
|
chris@160
|
40 #elif HV_SIMD_NEON
|
chris@160
|
41 *bOut = vextq_f32(o->x, bIn0, 3);
|
chris@160
|
42 o->x = bIn0;
|
chris@160
|
43 #else
|
chris@160
|
44 *bOut = o->x;
|
chris@160
|
45 o->x = bIn0;
|
chris@160
|
46 #endif
|
chris@160
|
47 }
|
chris@160
|
48
|
chris@160
|
49 #endif // _SIGNAL_DEL1_H_
|