ReactOS  0.4.15-dev-489-g75a0787
clearfp.c File Reference
#include <precomp.h>
Include dependency graph for clearfp.c:

Go to the source code of this file.

Functions

unsigned int _statusfp (void)
 
unsigned int CDECL _clearfp (void)
 

Function Documentation

◆ _clearfp()

unsigned int CDECL _clearfp ( void  )

Definition at line 18 of file clearfp.c.

19 {
20  unsigned int retVal = _statusfp();
21 #if defined(__GNUC__)
22  __asm__ __volatile__( "fnclex" );
23 #else
24  __asm fnclex;
25 #endif
26  return retVal;
27 }
unsigned int _statusfp(void)
Definition: statfp.c:25
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")

◆ _statusfp()

unsigned int _statusfp ( void  )

Definition at line 25 of file statfp.c.

26 {
27  unsigned int retVal = 0;
28  unsigned short fpword;
29 
30 #ifdef _M_AMD64
31  fpword = _mm_getcsr();
32 #elif defined(__GNUC__)
33  __asm__ __volatile__( "fstsw %0" : "=m" (fpword) : );
34 #else // _MSC_VER
35  __asm fstsw [fpword];
36 #endif
37  if (fpword & 0x1) retVal |= _SW_INVALID;
38  if (fpword & 0x2) retVal |= _SW_DENORMAL;
39  if (fpword & 0x4) retVal |= _SW_ZERODIVIDE;
40  if (fpword & 0x8) retVal |= _SW_OVERFLOW;
41  if (fpword & 0x10) retVal |= _SW_UNDERFLOW;
42  if (fpword & 0x20) retVal |= _SW_INEXACT;
43  return retVal;
44 }
#define _SW_ZERODIVIDE
Definition: statfp.c:16
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define _SW_INEXACT
Definition: statfp.c:19
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
#define _SW_DENORMAL
Definition: statfp.c:20
__INTRIN_INLINE unsigned int _mm_getcsr(void)
Definition: xmmintrin.h:59
#define _SW_UNDERFLOW
Definition: statfp.c:17
#define _SW_INVALID
Definition: statfp.c:15
#define _SW_OVERFLOW
Definition: statfp.c:18
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706

Referenced by _clearfp().