chris@160: /** chris@160: * Copyright (c) 2014, 2015, Enzien Audio Ltd. chris@160: * chris@160: * Permission to use, copy, modify, and/or distribute this software for any chris@160: * purpose with or without fee is hereby granted, provided that the above chris@160: * copyright notice and this permission notice appear in all copies. chris@160: * chris@160: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH chris@160: * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY chris@160: * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, chris@160: * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM chris@160: * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR chris@160: * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR chris@160: * PERFORMANCE OF THIS SOFTWARE. chris@160: */ chris@160: chris@160: #ifndef _SIGNAL_DEL1_H_ chris@160: #define _SIGNAL_DEL1_H_ chris@160: chris@160: #include "HvBase.h" chris@160: chris@160: typedef struct SignalDel1 { chris@160: hv_bufferf_t x; chris@160: } SignalDel1; chris@160: chris@160: hv_size_t sDel1_init(SignalDel1 *o); chris@160: chris@160: void sDel1_onMessage(HvBase *_c, SignalDel1 *o, int letIn, const HvMessage *m); chris@160: chris@160: static inline void __hv_del1_f(SignalDel1 *o, hv_bInf_t bIn0, hv_bOutf_t bOut) { chris@160: #if HV_SIMD_AVX chris@160: __m256 x = _mm256_permute_ps(bIn0, _MM_SHUFFLE(2,1,0,3)); // [3 0 1 2 7 4 5 6] chris@160: __m256 n = _mm256_permute2f128_ps(o->x,x,0x1); // [h e f g 3 0 1 2] chris@160: *bOut = _mm256_blend_ps(x, n, 0x11); // [g 0 1 2 3 4 5 6] chris@160: o->x = x; chris@160: #elif HV_SIMD_SSE chris@160: __m128 n = _mm_blend_ps(o->x, bIn0, 0x7); chris@160: *bOut = _mm_shuffle_ps(n, n, _MM_SHUFFLE(2,1,0,3)); chris@160: o->x = bIn0; chris@160: #elif HV_SIMD_NEON chris@160: *bOut = vextq_f32(o->x, bIn0, 3); chris@160: o->x = bIn0; chris@160: #else chris@160: *bOut = o->x; chris@160: o->x = bIn0; chris@160: #endif chris@160: } chris@160: chris@160: #endif // _SIGNAL_DEL1_H_