use compiler intrinsics for windows x64 build (FSBUILD-131)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12246 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2009-02-23 17:56:59 +00:00
1 parent ccb556ba48
commit 843a1da0b2
3 files changed
+41 -21

No files matched your search

+20 -3
View File
@@ -127,17 +127,34 @@ __inline long lrintf (float flt)
return retval;
}
#elif defined(_WIN64)
#include <intrin.h>
__inline__ long int rint(double x)
{
return (long int) (x);
#ifdef _M_X64
return (long int)_mm_cvtsd_si64x( _mm_loadu_pd ((const double*)&x) );
#else
#warning "Not Supported: Replacing with a simple C cast."
return (long int) (x);
#endif
}
__inline__ int rintf(float x)
{
return (int) rint((double) x);
#ifdef _M_X64
return _mm_cvt_ss2si( _mm_load_ss((const float*)&x) );
#else
#warning "Not Supported: Replacing with a simple C cast."
return (int) (x);
#endif
}
__inline__ long int lrintf(float x)
{
return (long int) (x);
#ifdef _M_X64
return _mm_cvt_ss2si( _mm_load_ss((const float*)&x) );
#else
#warning "Not Supported: Replacing with a simple C cast."
return (long int) (x);
#endif
}
#endif