Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-02-28 17:13:19 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-02-28 17:13:19 +0300
commit76a9cb772b6d8e98dc2fc8ef1ea197e0851e1037 (patch)
treed7a4705ad9fe9c6589b99cb8900b385f86e5ce31 /winsup/cygwin/fenv.cc
parent90232fa641692f1bf8ba100af00714f448cc7527 (diff)
Cygwin: initialize FP environment for each applicaiton threadfp-zeuch
Also, initialize FP environment in timerfd thread before calling RegisterClassW to avoid a spurious STATUS_FLOAT_INEXACT_RESULT from msvcrt.dll. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/fenv.cc')
-rw-r--r--winsup/cygwin/fenv.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/winsup/cygwin/fenv.cc b/winsup/cygwin/fenv.cc
index 396f98af4..a2c835915 100644
--- a/winsup/cygwin/fenv.cc
+++ b/winsup/cygwin/fenv.cc
@@ -420,7 +420,7 @@ fesetprec (int prec)
/* Set up the FPU and SSE environment at the start of execution. */
void
-_feinitialise (void)
+_feinitialise (bool pre_main)
{
unsigned int edx, eax;
@@ -442,14 +442,18 @@ _feinitialise (void)
if (use_sse)
__asm__ volatile ("ldmxcsr %0" :: "m" (mxcsr));
- /* Setup unmasked environment, but leave __FE_DENORM masked. */
- feenableexcept (FE_ALL_EXCEPT);
- fegetenv (&fe_nomask_env);
+ if (pre_main)
+ {
+ /* Setup unmasked environment, but leave __FE_DENORM masked. */
+ feenableexcept (FE_ALL_EXCEPT);
+ fegetenv (&fe_nomask_env);
- /* Restore default exception masking (all masked). */
- fedisableexcept (FE_ALL_EXCEPT);
+ /* Restore default exception masking (all masked). */
+ fedisableexcept (FE_ALL_EXCEPT);
- /* Finally cache state as default environment. */
- fegetenv (&fe_dfl_env);
+ /* Finally cache state as default environment. */
+ fegetenv (&fe_dfl_env);
+ }
+ else
+ fedisableexcept (FE_ALL_EXCEPT);
}
-