[PATCH 1/3] msvcrt: Implement _statusfp for arm
Martin Storsjö
martin at martin.st
Tue Aug 3 07:56:10 CDT 2021
Signed-off-by: Martin Storsjö <martin at martin.st>
---
dlls/msvcrt/math.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index 124cdf80098..5b72005170d 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -5206,6 +5206,16 @@ unsigned int CDECL _statusfp(void)
if (fpsr & 0x8) flags |= _SW_UNDERFLOW;
if (fpsr & 0x10) flags |= _SW_INEXACT;
if (fpsr & 0x80) flags |= _SW_DENORMAL;
+#elif defined(__arm__)
+ DWORD fpscr;
+
+ __asm__ __volatile__( "vmrs %0, fpscr" : "=r" (fpscr) );
+ if (fpscr & 0x1) flags |= _SW_INVALID;
+ if (fpscr & 0x2) flags |= _SW_ZERODIVIDE;
+ if (fpscr & 0x4) flags |= _SW_OVERFLOW;
+ if (fpscr & 0x8) flags |= _SW_UNDERFLOW;
+ if (fpscr & 0x10) flags |= _SW_INEXACT;
+ if (fpscr & 0x80) flags |= _SW_DENORMAL;
#else
FIXME( "not implemented\n" );
#endif
--
2.25.1
More information about the wine-devel
mailing list