diff _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
line wrap: on
line diff
--- a/_peck_fft_guts.h	Fri Sep 16 13:08:20 2011 +0200
+++ b/_peck_fft_guts.h	Fri Sep 16 14:04:19 2011 +0200
@@ -125,17 +125,25 @@
 
 
 #ifdef FIXED_POINT
-#  define PECK_FFT_COS(phase)  floor(.5+SAMP_MAX * cos (phase))
-#  define PECK_FFT_SIN(phase)  floor(.5+SAMP_MAX * sin (phase))
-#  define HALF_OF(x) ((x)>>1)
-#elif defined(USE_SIMD)
-#  define PECK_FFT_COS(phase) _mm_set1_ps( cos(phase) )
-#  define PECK_FFT_SIN(phase) _mm_set1_ps( sin(phase) )
-#  define HALF_OF(x) ((x)*_mm_set1_ps(.5))
+    #define PECK_FFT_COS(phase) floorf(0.5f+SAMP_MAX * cosf(phase))
+    #define PECK_FFT_SIN(phase) floorf(0.5f+SAMP_MAX * sinf(phase))
+    #define HALF_OF(x) ((x)>>1)
+#elif USE_SIMD == SIMD_SSE2
+    #define PECK_FFT_COS(phase) _mm_set1_ps(cosf(phase))
+    #define PECK_FFT_SIN(phase) _mm_set1_ps(sinf(phase))
+    #define HALF_OF(x) ((x)*_mm_set1_ps(0.5f))
+#elif USE_SIMD == SIMD_NEON4
+    #define PECK_FFT_COS(phase) vdupq_n_f32(cosf(phase))
+    #define PECK_FFT_SIN(phase) vdupq_n_f32(sinf(phase))
+    #define HALF_OF(x) ((x)*vdupq_n_f32(0.5f))
+#elif USE_SIMD == SIMD_NEON2
+    #define PECK_FFT_COS(phase) vdup_n_f32(cosf(phase))
+    #define PECK_FFT_SIN(phase) vdup_n_f32(sinf(phase))
+    #define HALF_OF(x) ((x)*vdup_n_f32(0.5f))
 #else
-#  define PECK_FFT_COS(phase) (peck_fft_scalar) cos(phase)
-#  define PECK_FFT_SIN(phase) (peck_fft_scalar) sin(phase)
-#  define HALF_OF(x) ((x)*.5)
+    #define PECK_FFT_COS(phase) (peck_fft_scalar) cosf(phase)
+    #define PECK_FFT_SIN(phase) (peck_fft_scalar) sinf(phase)
+    #define HALF_OF(x) ((x)*0.5f)
 #endif
 
 #define  kf_cexp(x,phase) \

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.