mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 19:31:45 +00:00
[CRT] Fix amd64 floating point control functions
This commit is contained in:
parent
39f11249ff
commit
76086220fa
10 changed files with 243 additions and 32 deletions
33
sdk/lib/crt/float/amd64/_statusfp.c
Normal file
33
sdk/lib/crt/float/amd64/_statusfp.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* PROJECT: ReactOS CRT
|
||||
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||
* PURPOSE: x64 implementation of _statusfp
|
||||
* COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer@reactos.org>
|
||||
*/
|
||||
|
||||
#include <float.h>
|
||||
#include <xmmintrin.h>
|
||||
|
||||
unsigned int __cdecl _statusfp(void)
|
||||
{
|
||||
unsigned int mxcsr, status = 0;
|
||||
|
||||
/* Get MXCSR */
|
||||
mxcsr = _mm_getcsr();
|
||||
|
||||
/* Convert to abstract status flags */
|
||||
if (mxcsr & _MM_EXCEPT_INVALID)
|
||||
status |= _SW_INVALID;
|
||||
if (mxcsr & _MM_EXCEPT_DENORM)
|
||||
status |= _SW_DENORMAL;
|
||||
if (mxcsr & _MM_EXCEPT_DIV_ZERO)
|
||||
status |= _SW_ZERODIVIDE;
|
||||
if (mxcsr & _MM_EXCEPT_OVERFLOW)
|
||||
status |= _SW_OVERFLOW;
|
||||
if (mxcsr & _MM_EXCEPT_UNDERFLOW)
|
||||
status |= _SW_UNDERFLOW;
|
||||
if (mxcsr & _MM_EXCEPT_INEXACT)
|
||||
status |= _SW_INEXACT;
|
||||
|
||||
return status;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue