mirror of
https://github.com/mborgerding/kissfft.git
synced 2026-05-25 13:08:42 -04:00
loongarch: add lsx simd opt
This commit is contained in:
@@ -128,6 +128,16 @@ struct kiss_fft_state{
|
||||
# define KISS_FFT_COS(phase) floor(.5+SAMP_MAX * cos (phase))
|
||||
# define KISS_FFT_SIN(phase) floor(.5+SAMP_MAX * sin (phase))
|
||||
# define HALF_OF(x) ((x)>>1)
|
||||
#elif defined(USE_SIMD) && defined(HAVE_LSX)
|
||||
#define KISS_FFT_COS(phase) ({ \
|
||||
float __cos_val = cosf(phase); \
|
||||
(__m128)(__lsx_vldrepl_w(&__cos_val, 0)); \
|
||||
})
|
||||
#define KISS_FFT_SIN(phase) ({ \
|
||||
float __sin_val = sinf(phase); \
|
||||
(__m128)(__lsx_vldrepl_w(&__sin_val, 0)); \
|
||||
})
|
||||
#define HALF_OF(x) ((x) * (__m128)(__lsx_vreplgr2vr_w(0x3F000000))) // 0.5f
|
||||
#elif defined(USE_SIMD)
|
||||
# define KISS_FFT_COS(phase) _mm_set1_ps( cos(phase) )
|
||||
# define KISS_FFT_SIN(phase) _mm_set1_ps( sin(phase) )
|
||||
|
||||
Reference in New Issue
Block a user