[Numpy-svn] r6461 - trunk/numpy/core/include/numpy

numpy-svn@scip... numpy-svn@scip...
Mon Feb 23 10:32:53 CST 2009


Author: cdavid
Date: 2009-02-23 10:32:46 -0600 (Mon, 23 Feb 2009)
New Revision: 6461

Modified:
   trunk/numpy/core/include/numpy/mingw_amd64_fenv.h
Log:
Add fesetexceptflag func for mingw-w64 support.

Modified: trunk/numpy/core/include/numpy/mingw_amd64_fenv.h
===================================================================
--- trunk/numpy/core/include/numpy/mingw_amd64_fenv.h	2009-02-23 16:25:45 UTC (rev 6460)
+++ trunk/numpy/core/include/numpy/mingw_amd64_fenv.h	2009-02-23 16:32:46 UTC (rev 6461)
@@ -66,13 +66,20 @@
 }
 
 static __inline int
-npy_fegetexceptflag(npy_fexcept_t *__flagp, int __excepts)
+npy_fesetexceptflag(const npy_fexcept_t *flagp, int excepts)
 {
-	int __mxcsr, __status;
+	npy_fenv_t env;
 
-	__stmxcsr(&__mxcsr);
-	__fnstsw(&__status);
-	*__flagp = (__mxcsr | __status) & __excepts;
+	__fnstenv(&env.__x87);
+	env.__x87.__status &= ~excepts;
+	env.__x87.__status |= *flagp & excepts;
+	__fldenv(env.__x87);
+
+	__stmxcsr(&env.__mxcsr);
+	env.__mxcsr &= ~excepts;
+	env.__mxcsr |= *flagp & excepts;
+	__ldmxcsr(env.__mxcsr);
+
 	return (0);
 }
 



More information about the Numpy-svn mailing list