fork/rust-sdks

git clone https://git.julia.blue/fork/rust-sdks

Théo Monnomsoxr-sys (#438)2e4d385

livekit/livekit-ffi@0.13.0
1.5 KiB40 linesraw
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/* AVX support macros */
5
6#if !defined soxr_avx_included
7#define soxr_avx_included
8
9#include <immintrin.h>
10
11typedef __m256d v4sf;
12#define VZERO() _mm256_setzero_pd()
13#define VMUL(a,b) _mm256_mul_pd(a,b)
14#define VADD(a,b) _mm256_add_pd(a,b)
15#define VMADD(a,b,c) VADD(VMUL(a,b),c) /* Note: gcc -mfma will `fuse' these */
16#define VSUB(a,b) _mm256_sub_pd(a,b)
17#define LD_PS1(p) _mm256_set1_pd(p)
18#define INTERLEAVE2(in1, in2, out1, out2) {v4sf \
19  t1 = _mm256_unpacklo_pd(in1, in2), \
20  t2 = _mm256_unpackhi_pd(in1, in2); \
21  out1 = _mm256_permute2f128_pd(t1,t2,0x20); \
22  out2 = _mm256_permute2f128_pd(t1,t2,0x31); }
23#define UNINTERLEAVE2(in1, in2, out1, out2) {v4sf \
24  t1 = _mm256_permute2f128_pd(in1,in2,0x20), \
25  t2 = _mm256_permute2f128_pd(in1,in2,0x31); \
26  out1 = _mm256_unpacklo_pd(t1, t2); \
27  out2 = _mm256_unpackhi_pd(t1, t2);}
28#define VTRANSPOSE4(x0,x1,x2,x3) {v4sf \
29  t0 = _mm256_shuffle_pd(x0,x1, 0x0), \
30  t2 = _mm256_shuffle_pd(x0,x1, 0xf), \
31  t1 = _mm256_shuffle_pd(x2,x3, 0x0), \
32  t3 = _mm256_shuffle_pd(x2,x3, 0xf); \
33  x0 = _mm256_permute2f128_pd(t0,t1, 0x20); \
34  x1 = _mm256_permute2f128_pd(t2,t3, 0x20); \
35  x2 = _mm256_permute2f128_pd(t0,t1, 0x31); \
36  x3 = _mm256_permute2f128_pd(t2,t3, 0x31);}
37#define VSWAPHL(a,b) _mm256_permute2f128_pd(b, a, 0x30)
38#define VALIGNED(ptr) ((((long)(ptr)) & 0x1F) == 0)
39
40#endif