Mercurial > hg > peckfft
comparison _peck_fft_guts.h @ 4:2d6c49fcafcb
neon2 and neon4 support
author | Peter Meerwald <p.meerwald@bct-electronic.com> |
---|---|
date | Fri, 16 Sep 2011 14:04:19 +0200 |
parents | 723f588b82ac |
children | fee54f1878f7 |
comparison
equal
deleted
inserted
replaced
3:3b31bd44a09f | 4:2d6c49fcafcb |
---|---|
123 (res).r -= (a).r; (res).i -= (a).i; \ | 123 (res).r -= (a).r; (res).i -= (a).i; \ |
124 }while(0) | 124 }while(0) |
125 | 125 |
126 | 126 |
127 #ifdef FIXED_POINT | 127 #ifdef FIXED_POINT |
128 # define PECK_FFT_COS(phase) floor(.5+SAMP_MAX * cos (phase)) | 128 #define PECK_FFT_COS(phase) floorf(0.5f+SAMP_MAX * cosf(phase)) |
129 # define PECK_FFT_SIN(phase) floor(.5+SAMP_MAX * sin (phase)) | 129 #define PECK_FFT_SIN(phase) floorf(0.5f+SAMP_MAX * sinf(phase)) |
130 # define HALF_OF(x) ((x)>>1) | 130 #define HALF_OF(x) ((x)>>1) |
131 #elif defined(USE_SIMD) | 131 #elif USE_SIMD == SIMD_SSE2 |
132 # define PECK_FFT_COS(phase) _mm_set1_ps( cos(phase) ) | 132 #define PECK_FFT_COS(phase) _mm_set1_ps(cosf(phase)) |
133 # define PECK_FFT_SIN(phase) _mm_set1_ps( sin(phase) ) | 133 #define PECK_FFT_SIN(phase) _mm_set1_ps(sinf(phase)) |
134 # define HALF_OF(x) ((x)*_mm_set1_ps(.5)) | 134 #define HALF_OF(x) ((x)*_mm_set1_ps(0.5f)) |
135 #elif USE_SIMD == SIMD_NEON4 | |
136 #define PECK_FFT_COS(phase) vdupq_n_f32(cosf(phase)) | |
137 #define PECK_FFT_SIN(phase) vdupq_n_f32(sinf(phase)) | |
138 #define HALF_OF(x) ((x)*vdupq_n_f32(0.5f)) | |
139 #elif USE_SIMD == SIMD_NEON2 | |
140 #define PECK_FFT_COS(phase) vdup_n_f32(cosf(phase)) | |
141 #define PECK_FFT_SIN(phase) vdup_n_f32(sinf(phase)) | |
142 #define HALF_OF(x) ((x)*vdup_n_f32(0.5f)) | |
135 #else | 143 #else |
136 # define PECK_FFT_COS(phase) (peck_fft_scalar) cos(phase) | 144 #define PECK_FFT_COS(phase) (peck_fft_scalar) cosf(phase) |
137 # define PECK_FFT_SIN(phase) (peck_fft_scalar) sin(phase) | 145 #define PECK_FFT_SIN(phase) (peck_fft_scalar) sinf(phase) |
138 # define HALF_OF(x) ((x)*.5) | 146 #define HALF_OF(x) ((x)*0.5f) |
139 #endif | 147 #endif |
140 | 148 |
141 #define kf_cexp(x,phase) \ | 149 #define kf_cexp(x,phase) \ |
142 do{ \ | 150 do{ \ |
143 (x)->r = PECK_FFT_COS(phase);\ | 151 (x)->r = PECK_FFT_COS(phase);\ |