ReactOS  0.4.15-dev-5079-gf79e80c
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 }
__asm__("\n\t \ NewInt3Handler:\n\t \ pushl $" STR(REASON_INT3) "\n\t \ // call debugger loop\n\t \ jmp NewInt31Handler\n\t \ ")
unsigned int _statusfp(void)
Definition: _statusfp.c:11

Referenced by main(), and Test_exceptions().

◆ _statusfp()

unsigned int _statusfp ( void  )

Definition at line 11 of file _statusfp.c.

12 {
13  unsigned int mxcsr, status = 0;
14 
15  /* Get MXCSR */
16  mxcsr = _mm_getcsr();
17 
18  /* Convert to abstract status flags */
19  if (mxcsr & _MM_EXCEPT_INVALID)
21  if (mxcsr & _MM_EXCEPT_DENORM)
23  if (mxcsr & _MM_EXCEPT_DIV_ZERO)
25  if (mxcsr & _MM_EXCEPT_OVERFLOW)
27  if (mxcsr & _MM_EXCEPT_UNDERFLOW)
29  if (mxcsr & _MM_EXCEPT_INEXACT)
31 
32  return status;
33 }
unsigned int _mm_getcsr(void)
Definition: xmmintrin.h:535
#define _MM_EXCEPT_DIV_ZERO
Definition: xmmintrin.h:96
#define _MM_EXCEPT_DENORM
Definition: xmmintrin.h:95
#define _SW_DENORMAL
Definition: float.h:90
#define _SW_INVALID
Definition: float.h:89
#define _SW_UNDERFLOW
Definition: float.h:86
#define _MM_EXCEPT_UNDERFLOW
Definition: xmmintrin.h:98
#define _MM_EXCEPT_INVALID
Definition: xmmintrin.h:94
#define _MM_EXCEPT_OVERFLOW
Definition: xmmintrin.h:97
#define _SW_INEXACT
Definition: float.h:85
#define _MM_EXCEPT_INEXACT
Definition: xmmintrin.h:99
#define _SW_OVERFLOW
Definition: float.h:87
#define _SW_ZERODIVIDE
Definition: float.h:88
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by _clearfp().