From e0ae980165e390943cf5d02a67da77d46a5a843c Mon Sep 17 00:00:00 2001 From: John Ridges Date: Sat, 16 Oct 2010 18:00:54 -0400 Subject: [PATCH] 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"). --- libcelt/float_cast.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libcelt/float_cast.h b/libcelt/float_cast.h index 280b4911..b2ffe240 100644 --- a/libcelt/float_cast.h +++ b/libcelt/float_cast.h @@ -72,6 +72,13 @@ #include #define float2int(x) lrint(x) +#elif (defined (WIN64) || defined (_WIN64)) + #include + + __inline long int float2int(float value) + { + return _mm_cvtss_si32(_mm_load_ss(&value)); + } #elif (defined (WIN32) || defined (_WIN32)) #include