mirror of
https://github.com/mborgerding/kissfft.git
synced 2026-02-23 07:22:56 -05:00
Allow setting a suffix for constants and trigonometric functions
In order to use constants or trigonometric functions with a type other than
double, a suffix ('f' for float or 'l' for long double) has to be used in C.
This commit adds a preprocessor macro 'kiss_fft_suffix' which can be set to
either 'f' or 'l' and which will be added to floating point constants and to
the trigonometric functions (sin and cos).
Without this suffix, the code will use a too high precision for float and a
too low precision for long double.
This commit is contained in:
@ -35,6 +35,8 @@ extern "C" {
|
||||
#ifdef USE_SIMD
|
||||
# include <xmmintrin.h>
|
||||
# define kiss_fft_scalar __m128
|
||||
# define kiss_fft_scalar_one double
|
||||
//# define kiss_fft_scalar_one float
|
||||
# ifndef KISS_FFT_MALLOC
|
||||
# define KISS_FFT_MALLOC(nbytes) _mm_malloc(nbytes,16)
|
||||
# endif
|
||||
@ -55,8 +57,10 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
# if (FIXED_POINT == 32)
|
||||
# define kiss_fft_scalar int32_t
|
||||
# define kiss_fft_scalar_one double
|
||||
# else
|
||||
# define kiss_fft_scalar int16_t
|
||||
# define kiss_fft_scalar_one double
|
||||
# endif
|
||||
#else
|
||||
# ifndef kiss_fft_scalar
|
||||
|
||||
Reference in New Issue
Block a user