ReactOS  0.4.15-dev-5499-g1341c38
_statusfp.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS CRT library
3  * LICENSE: MIT (https://spdx.org/licenses/MIT)
4  * PURPOSE: Implementation of _statusfp
5  * COPYRIGHT: Copyright 2021 Roman Masanin <36927roma@gmail.com>
6  */
7 
8 #include "fpscr.h"
9 
10 unsigned int _statusfp(void)
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:90
struct _ARM_FPSCR::@4070 data
#define _SW_INVALID
Definition: float.h:89
#define _SW_UNDERFLOW
Definition: float.h:86
unsigned int __getfp(void)
GLbitfield flags
Definition: glext.h:7161
#define ARM_CW_IM
Definition: fpscr.h:11
unsigned int __cdecl _statusfp(void)
Definition: _statusfp.c:11
#define _SW_INEXACT
Definition: float.h:85
#define ARM_CW_OM
Definition: fpscr.h:13
unsigned int raw
Definition: fpscr.h:25
#define _SW_OVERFLOW
Definition: float.h:87
#define _SW_ZERODIVIDE
Definition: float.h:88
#define ARM_CW_ZM
Definition: fpscr.h:12