mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Blrintf
git-svn-id: https://svn.eduke32.com/eduke32@4632 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
71bb5e5c8e
commit
7c79d2ce80
1 changed files with 16 additions and 0 deletions
|
@ -168,8 +168,24 @@ static inline long lround(double num)
|
||||||
return (long) (num > 0 ? num + 0.5 : ceil(num - 0.5));
|
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
|
#else
|
||||||
# define longlong(x) x##ll
|
# define longlong(x) x##ll
|
||||||
|
#define Blrintf lrintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __OPENDINGUX__
|
#if defined __OPENDINGUX__
|
||||||
|
|
Loading…
Reference in a new issue