ReactOS 0.4.15-dev-8227-g32d615f
_statusfp.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS CRT
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: x64 implementation of _statusfp
5 * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer@reactos.org>
6 */
7
8#include <float.h>
9#include <xmmintrin.h>
10
11unsigned int __cdecl _statusfp(void)
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 __cdecl
Definition: accygwin.h:79
unsigned int __cdecl _statusfp(void)
Definition: _statusfp.c:11
#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