git-svn-id: https://svn.eduke32.com/eduke32@4632 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2014-09-30 04:16:35 +00:00
parent 71bb5e5c8e
commit 7c79d2ce80
1 changed files with 16 additions and 0 deletions

View File

@ -168,8 +168,24 @@ static inline long lround(double num)
return (long) (num > 0 ? num + 0.5 : ceil(num - 0.5));
}
#if defined(_WIN64)
#include <emmintrin.h>
static inline int32_t Blrintf(const float x)
{
__m128 xx = _mm_load_ss(&x);
return _mm_cvtss_si32(xx);
}
#else
static inline int32_t Blrintf(const float x)
{
int n;
__asm fld x;
__asm fistp n;
} return n;
#endif
#else
# define longlong(x) x##ll
#define Blrintf lrintf
#endif
#if defined __OPENDINGUX__