mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 00:20:06 +02:00
Adds an SSE2 version of lrint family
For some reason, MSVC builtin version have extremely low performance
This commit is contained in:
parent
a5d74f564d
commit
bfb79feed3
@ -106,15 +106,38 @@
|
||||
|
||||
return intgr ;
|
||||
}
|
||||
#elif (defined (WIN32) || defined (_WIN32)) && defined(_M_3X64)
|
||||
#elif (defined (WIN32) || defined (_WIN32)) && defined(_M_X64)
|
||||
|
||||
#include <math.h>
|
||||
#include <immintrin.h>
|
||||
#include <emmintrin.h>
|
||||
|
||||
__inline long int
|
||||
lrintf (float flt)
|
||||
#ifdef _MSC_VER
|
||||
#pragma function(lrint, lrintf)
|
||||
#endif
|
||||
|
||||
__inline
|
||||
long int lrint(double flt)
|
||||
{
|
||||
return _mm_cvt_ss2si(_mm_set_ss(flt));
|
||||
return _mm_cvtsd_si32(_mm_set_sd(flt));
|
||||
}
|
||||
|
||||
__inline
|
||||
long int lrintf (float flt)
|
||||
{
|
||||
return _mm_cvtss_si32(_mm_set_ss(flt));
|
||||
}
|
||||
|
||||
__inline
|
||||
long long int llrint(double flt)
|
||||
{
|
||||
return _mm_cvtsd_si64(_mm_set_sd(flt));
|
||||
}
|
||||
|
||||
__inline
|
||||
long long int llrintf(float flt)
|
||||
{
|
||||
return _mm_cvtss_si64(_mm_set_ss(flt));
|
||||
}
|
||||
|
||||
#elif (HAVE_LRINT && HAVE_LRINTF)
|
||||
|
Loading…
x
Reference in New Issue
Block a user