ReactOS 0.4.15-dev-7953-g1f49173
statfp.c File Reference
#include <precomp.h>
#include "float.h"
Include dependency graph for statfp.c:

Go to the source code of this file.

Macros

#define _SW_INVALID   0x00000010 /* invalid */
 
#define _SW_ZERODIVIDE   0x00000008 /* zero divide */
 
#define _SW_UNDERFLOW   0x00000002 /* underflow */
 
#define _SW_OVERFLOW   0x00000004 /* overflow */
 
#define _SW_INEXACT   0x00000001 /* inexact (precision) */
 
#define _SW_DENORMAL   0x00080000 /* denormal status bit */
 

Functions

unsigned int CDECL _statusfp (void)
 

Macro Definition Documentation

◆ _SW_DENORMAL

#define _SW_DENORMAL   0x00080000 /* denormal status bit */

Definition at line 20 of file statfp.c.

◆ _SW_INEXACT

#define _SW_INEXACT   0x00000001 /* inexact (precision) */

Definition at line 19 of file statfp.c.

◆ _SW_INVALID

#define _SW_INVALID   0x00000010 /* invalid */

Definition at line 15 of file statfp.c.

◆ _SW_OVERFLOW

#define _SW_OVERFLOW   0x00000004 /* overflow */

Definition at line 18 of file statfp.c.

◆ _SW_UNDERFLOW

#define _SW_UNDERFLOW   0x00000002 /* underflow */

Definition at line 17 of file statfp.c.

◆ _SW_ZERODIVIDE

#define _SW_ZERODIVIDE   0x00000008 /* zero divide */

Definition at line 16 of file statfp.c.

Function Documentation

◆ _statusfp()

unsigned int CDECL _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}
__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")
#define _SW_INEXACT
Definition: statfp.c:19
#define _SW_OVERFLOW
Definition: statfp.c:18
#define _SW_DENORMAL
Definition: statfp.c:20
#define _SW_ZERODIVIDE
Definition: statfp.c:16
#define _SW_UNDERFLOW
Definition: statfp.c:17
#define _SW_INVALID
Definition: statfp.c:15
unsigned int _mm_getcsr(void)
Definition: xmmintrin.h:535

Referenced by _clearfp(), START_TEST(), and Test_exceptions().