Author: tkreuzer
Date: Sun Sep 15 17:31:25 2013
New Revision: 60142
URL:
http://svn.reactos.org/svn/reactos?rev=60142&view=rev
Log:
[DSOUND]
Extend the lrint MSVC hack to support x64 as well
See
http://sourceforge.net/p/freeimage/discussion/36111/thread/b43c17c5
Modified:
trunk/reactos/dll/directx/dsound/dsound_convert.c
Modified: trunk/reactos/dll/directx/dsound/dsound_convert.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/dsound/dsound_…
==============================================================================
--- trunk/reactos/dll/directx/dsound/dsound_convert.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/dsound/dsound_convert.c [iso-8859-1] Sun Sep 15 17:31:25
2013
@@ -64,17 +64,26 @@
#endif
/* This is an inlined version of lrintf. */
-#if defined(_M_IX86) && defined(_MSC_VER)
+#if defined(_MSC_VER)
+#if defined(_M_AMD64)
+#include <xmmintrin.h>
+#endif
+
FORCEINLINE
int
lrintf(float f)
{
+#if defined(_M_IX86)
int result;
__asm
{
fld f;
fistp result;
}
+ return result;
+#elif defined(_M_AMD64)
+ return _mm_cvtss_si32(_mm_load_ss(&f));
+#endif
}
#endif