Skip to content

Commit

Permalink
Merge pull request numpy#3691 from juliantaylor/windows-fpu-fix
Browse files Browse the repository at this point in the history
BUG: fix windows fpu flag check for mixed x87 and sse instructions
  • Loading branch information
charris committed Sep 6, 2013
2 parents b9b0ea5 + 554ee09 commit 1ec9419
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion numpy/core/include/numpy/ufuncobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 1ec9419

Please sign in to comment.