ReactOS  0.4.15-dev-3428-g0609db5
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:10

Referenced by main().

◆ _statusfp()

unsigned int _statusfp ( void  )

Definition at line 10 of file _statusfp.c.

11 {
12  unsigned int flags = 0;
13  ARM_FPSCR fpscr;
14 
15  fpscr.raw = __getfp();
16 
17  if (fpscr.data.exception & ARM_CW_IM) flags |= _SW_INVALID;
18  if (fpscr.data.exception & ARM_CW_ZM) flags |= _SW_ZERODIVIDE;
19  if (fpscr.data.exception & ARM_CW_OM) flags |= _SW_OVERFLOW;
20  if (fpscr.data.exception & ARM_CW_UM) flags |= _SW_UNDERFLOW;
21  if (fpscr.data.exception & ARM_CW_PM) flags |= _SW_INEXACT;
22  if (fpscr.data.exception & ARM_CW_DM) flags |= _SW_DENORMAL;
23  return flags;
24 }
#define ARM_CW_UM
Definition: fpscr.h:14
#define ARM_CW_PM
Definition: fpscr.h:15
#define ARM_CW_DM
Definition: fpscr.h:16
#define _SW_DENORMAL
Definition: float.h:86
struct _ARM_FPSCR::@4045 data
#define _SW_INVALID
Definition: float.h:85
#define _SW_UNDERFLOW
Definition: float.h:82
unsigned int __getfp(void)
GLbitfield flags
Definition: glext.h:7161
#define ARM_CW_IM
Definition: fpscr.h:11
#define _SW_INEXACT
Definition: float.h:81
#define ARM_CW_OM
Definition: fpscr.h:13
unsigned int raw
Definition: fpscr.h:25
#define _SW_OVERFLOW
Definition: float.h:83
#define _SW_ZERODIVIDE
Definition: float.h:84
#define ARM_CW_ZM
Definition: fpscr.h:12

Referenced by _clearfp().