fork/rust-sdks
git clone https://git.julia.blue/fork/rust-sdks
2e4d385
main
1/* SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net 2* Licence for this file: LGPL v2.1 See LICENCE for details. */ 3 4#if !definedsoxr_dev64s_included 5#define soxr_dev64s_included 6 7#if defined__GNUC__ 8#define SIMD_INLINE (T ) static __inline T __attribute__((always_inline)) 9#define vAlign __attribute__((aligned (32))) 10#elif defined_MSC_VER 11#define SIMD_INLINE (T ) static __forceinline T 12#define vAlign __declspec(align(32)) 13#else 14#define SIMD_INLINE (T ) static __inline T 15#endif 16 17#if defined__x86_64__ || defined_M_X64 || definedi386 || defined_M_IX86 18 19#include <immintrin.h> 20 21#if defined__AVX__ 22 23#define vZero () _mm256_setzero_pd() 24#define vSet1 (a ) _mm256_set_pd(0,0,0,a) 25#define vMul (a ,b ) _mm256_mul_pd(a,b) 26#define vAdd (a ,b ) _mm256_add_pd(a,b) 27#define vMac (a ,b ,c ) vAdd(vMul(a,b),c)/* Note: gcc -mfma will `fuse' these */ 28#define vLds (a ) _mm256_set1_pd(a) 29#define vLd (a ) _mm256_load_pd(a) 30#define vLdu (a ) _mm256_loadu_pd(a) 31 32typedef __m256d v4_t ; 33 34SIMD_INLINE (void )vStorSum (double * a ,v4_t b ) { 35b = _mm256_hadd_pd (b ,_mm256_permute2f128_pd (b ,b ,1 )); 36_mm_store_sd (a ,_mm256_castpd256_pd128 (_mm256_hadd_pd (b ,b )));} 37 38#endif 39 40#endif 41 42#endif