Optimised float->int cast for Win64

I've been compiling CELT for 64-bit Windows and it all seems to work
fine (with the occasional benign warning message) except for one place,
and that is in "float_cast.h" where there is some inline assembly
language that gets complied for Windows. Since the Microsoft 64-bit
compiler won't allow inline assembly language (and *still* doesn't have
"lrintf").
This commit is contained in:
John Ridges 2010-10-16 18:00:54 -04:00 committed by Jean-Marc Valin
parent bb918ef711
commit e0ae980165

View file

@ -72,6 +72,13 @@
#include <math.h>
#define float2int(x) lrint(x)
#elif (defined (WIN64) || defined (_WIN64))
#include <xmmintrin.h>
__inline long int float2int(float value)
{
return _mm_cvtss_si32(_mm_load_ss(&value));
}
#elif (defined (WIN32) || defined (_WIN32))
#include <math.h>