The control87 is a fake one when using USE_PORTABLE_C, regardless the architecture

This commit is contained in:
ptitSeb 2016-04-06 22:44:45 +02:00
parent efde059273
commit 2ccc337898

26
Sources/Engine/Math/Float.cpp Normal file → Executable file
View File

@ -17,24 +17,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <Engine/Math/Float.h>
#if (defined __GNU_INLINE__)
#define MCW_PC 0x0300
#define _MCW_PC MCW_PC
#define _PC_24 0x0000
#define _PC_53 0x0200
#define _PC_64 0x0300
#ifdef USE_PORTABLE_C
// Fake control87 for USE_PORTABLE_C version
inline ULONG _control87(WORD newcw, WORD mask)
{
#if __POWERPC__
static WORD fpw=_PC_64;
if (mask != 0)
{
fpw &= ~mask;
fpw |= (newcw & mask);
}
return(fpw);
#elif defined(__arm__)
static WORD fpw=_PC_64;
if (mask != 0)
{
@ -42,7 +34,13 @@ inline ULONG _control87(WORD newcw, WORD mask)
fpw |= (newcw & mask);
}
return(fpw);
}
#else
#if (defined __GNU_INLINE__)
inline ULONG _control87(WORD newcw, WORD mask)
{
WORD fpw = 0;
// get the current FPU control word...
@ -55,16 +53,10 @@ inline ULONG _control87(WORD newcw, WORD mask)
__asm__ __volatile__ (" fldcw %0" : : "m" (fpw) : "memory");
}
return(fpw);
#endif
}
// (for intel compiler...)
#elif ((defined __MSVC_INLINE__) && (!defined _MSC_VER))
#define MCW_PC 0x0300
#define _MCW_PC MCW_PC
#define _PC_24 0x0000
#define _PC_53 0x0200
#define _PC_64 0x0300
inline ULONG _control87(WORD newcw, WORD mask)
{
@ -85,7 +77,7 @@ inline ULONG _control87(WORD newcw, WORD mask)
#elif (!defined _MSC_VER)
#error Implement for your platform, or add a stub conditional here.
#endif
#endif
/* Get current precision setting of FPU. */
enum FPUPrecisionType GetFPUPrecision(void)
{