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:
parent
bb918ef711
commit
e0ae980165
1 changed files with 7 additions and 0 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue