ReactOS 0.4.15-dev-7693-gd0e2924
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: _statusfp.c:11
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tmov %rdx, %rbp\n" "\tjmp *%rax\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")

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}
#define _SW_INEXACT
Definition: float.h:85
#define _SW_OVERFLOW
Definition: float.h:87
#define _SW_DENORMAL
Definition: float.h:90
#define _SW_ZERODIVIDE
Definition: float.h:88
#define _SW_UNDERFLOW
Definition: float.h:86
#define _SW_INVALID
Definition: float.h:89
Definition: ps.c:97
#define _MM_EXCEPT_DIV_ZERO
Definition: xmmintrin.h:96
#define _MM_EXCEPT_UNDERFLOW
Definition: xmmintrin.h:98
#define _MM_EXCEPT_INEXACT
Definition: xmmintrin.h:99
#define _MM_EXCEPT_OVERFLOW
Definition: xmmintrin.h:97
#define _MM_EXCEPT_INVALID
Definition: xmmintrin.h:94
#define _MM_EXCEPT_DENORM
Definition: xmmintrin.h:95
unsigned int _mm_getcsr(void)
Definition: xmmintrin.h:535

Referenced by _clearfp().