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:
parent
ccb556ba48
commit
843a1da0b2
|
@ -41,7 +41,7 @@
|
|||
#include "syntFilter.h"
|
||||
|
||||
#if (defined(WIN32) || defined(_WIN32)) && !defined(_WIN64)
|
||||
__inline double rint(double dbl)
|
||||
__inline long int rint(double dbl)
|
||||
{
|
||||
_asm
|
||||
{
|
||||
|
@ -50,9 +50,15 @@
|
|||
}
|
||||
}
|
||||
#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
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -303,29 +303,26 @@ extern "C"
|
|||
}
|
||||
#elif defined(WIN64) || defined(_WIN64)
|
||||
/* x86_64 machines will do best with a simple assignment. */
|
||||
#include <intrin.h>
|
||||
|
||||
__inline long int lrint(double x)
|
||||
{
|
||||
long int i;
|
||||
|
||||
_asm
|
||||
{
|
||||
fld x
|
||||
fistp i
|
||||
};
|
||||
return i;
|
||||
#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 long int lrintf(float x)
|
||||
{
|
||||
long int i;
|
||||
|
||||
_asm
|
||||
{
|
||||
fld x
|
||||
fistp i
|
||||
};
|
||||
return i;
|
||||
#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
|
||||
}
|
||||
|
||||
__inline long int lfastrint(double x)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue