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>2011-03-20 18:34:29 +0300
committerCorinna Vinschen <corinna@vinschen.de>2011-03-20 18:34:29 +0300
commit33150e7f40f034cbffcb43fba1d560ce162ab3ff (patch)
tree4278614b351f9b5da14d3dce899ef825ea5b04d5 /winsup/cygwin/fenv.cc
parentb8bdc60019e426b4f0cef85d5f02ba803467fbd3 (diff)
* fenv.cc (_feinitialise); Don't use SSE instructions on systems not
supporting them. * wincap.h (wincaps::supports_sse): New element. * wincap.cc: Implement above element throughout.
Diffstat (limited to 'winsup/cygwin/fenv.cc')
-rwxr-xr-xwinsup/cygwin/fenv.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/winsup/cygwin/fenv.cc b/winsup/cygwin/fenv.cc
index 63670f7ab..87466365a 100755
--- a/winsup/cygwin/fenv.cc
+++ b/winsup/cygwin/fenv.cc
@@ -1,6 +1,6 @@
/* fenv.cc
- Copyright 2010 Red Hat, Inc.
+ Copyright 2010, 2011 Red Hat, Inc.
This file is part of Cygwin.
@@ -8,9 +8,11 @@ This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
-#include <string.h>
+#include "winsup.h"
#include "fenv.h"
#include "errno.h"
+#include "wincap.h"
+#include <string.h>
/* Mask and shift amount for rounding bits. */
#define FE_CW_ROUND_MASK (0x0c00)
@@ -419,8 +421,9 @@ _feinitialise (void)
/* Check for presence of SSE: invoke CPUID #1, check EDX bit 25. */
eax = 1;
__asm__ volatile ("cpuid" : "=d" (edx), "+a" (eax) :: "%ecx", "%ebx");
- /* If this flag isn't set, we'll avoid trying to execute any SSE. */
- if (edx & (1 << 25))
+ /* If this flag isn't set, or if the OS doesn't support SSE (NT4, at least
+ up to SP4) we'll avoid trying to execute any SSE. */
+ if ((edx & (1 << 25)) != 0 && wincap.supports_sse ())
use_sse = true;
/* Reset FPU: extended prec, all exceptions cleared and masked off. */