summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2013-09-06 23:12:13 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2013-09-06 23:14:03 +0200
commit554ee09d07a6dde8534ffacbbccffefab0fb0776 (patch)
tree2c2d0ace64743ecb13fd3db0211be5878d5ea9ce /numpy
parent573b3b0215294a881e3504cec8818ee194679342 (diff)
downloadnumpy-554ee09d07a6dde8534ffacbbccffefab0fb0776.tar.gz
BUG: fix windows fpu flag check for mixed x87 and sse instructions
windows enables sse intrinsics also on 32 bit by default so we need to check both the x87 and sse fpu flags. closes #3680
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/include/numpy/ufuncobject.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
index 8df96a44f..aab336da8 100644
--- a/numpy/core/include/numpy/ufuncobject.h
+++ b/numpy/core/include/numpy/ufuncobject.h
@@ -370,8 +370,12 @@ typedef struct _loop1d_info {
#define UFUNC_NOFPE _control87(MCW_EM, MCW_EM);
#endif
+/* windows enables sse on 32 bit, so check both flags */
#define UFUNC_CHECK_STATUS(ret) { \
- int fpstatus = (int) _clearfp(); \
+ int fpstatus, fpstatus2; \
+ _statusfp2(&fpstatus, &fpstatus2); \
+ _clearfp(); \
+ fpstatus |= fpstatus2; \
\
ret = ((SW_ZERODIVIDE & fpstatus) ? UFUNC_FPE_DIVIDEBYZERO : 0) \
| ((SW_OVERFLOW & fpstatus) ? UFUNC_FPE_OVERFLOW : 0) \