diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2006-07-03 10:32:58 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2006-07-03 10:32:58 +0000 |
commit | f34428eb356a001928e1786d51cbfe216ebeef83 (patch) | |
tree | d6319e46a0cc4bdaae18f49f4a4ad821677f895e /winsup/mingw/cpu_features.h | |
parent | 69d5f3329f4869d6d0e20f610926934fc0044dce (diff) | |
download | cygnal-f34428eb356a001928e1786d51cbfe216ebeef83.tar.gz cygnal-f34428eb356a001928e1786d51cbfe216ebeef83.tar.bz2 cygnal-f34428eb356a001928e1786d51cbfe216ebeef83.zip |
Support SSE float environment in fenv.h functions.
* cpu_features.c: New file.
* cpu_features.h: New file.
* crt1.c: Include "cpu_features.h".
(__mingw_CRTStartup): Call cpu_features_init().
* Makefile.in (MING_OBJS): Add cpu_features.c.
(SRCDIST_FILES): Add cpu_features.c, cpu_features.h.
* include/fenv,h ( fenv_t;): Append __mxcsr field.
(__MXCSR_EXCEPT_FLAG_SHIFT): New define.
(__MXCSR_EXCEPT_MASK_SHIFT): New define.
(__MXCSR_ROUND_FLAG_SHIFT): New define.
* mingwex/feclearexcept.c: Include "cpu_features.h".
Handle SSE environment.
* mingwex/fegetenv.c: Likewise.
* mingwex/feholdexcept.c: Likewise.
* mingwex/fesetenv.c: Likewise.
* mingwex/fesetexceptflag.c: Likewise.
* mingwex/fesetround.c: Likewise.
* mingwex/fetestexcept.c: Likewise.
* mingwex/feupdateenv.c: Likewise.
* mingwex/fegetround.c: Add comment.
Diffstat (limited to 'winsup/mingw/cpu_features.h')
-rwxr-xr-x | winsup/mingw/cpu_features.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/winsup/mingw/cpu_features.h b/winsup/mingw/cpu_features.h new file mode 100755 index 000000000..a19f875c8 --- /dev/null +++ b/winsup/mingw/cpu_features.h @@ -0,0 +1,23 @@ +#ifndef _CPU_FEATURES_H +#define _CPU_FEATURES_H + +#include <stdbool.h> + +#define _CRT_CMPXCHG8B 0x0001 +#define _CRT_CMOV 0x0002 +#define _CRT_MMX 0x0004 +#define _CRT_FXSR 0x0008 +#define _CRT_SSE 0x0010 +#define _CRT_SSE2 0x0020 +#define _CRT_SSE3 0x0040 +#define _CRT_CMPXCHG16B 0x0080 +#define _CRT_3DNOW 0x0100 +#define _CRT_3DNOWP 0x0200 + +extern unsigned int __cpu_features; + +/* Currently we use this in fpenv functions */ +#define __HAS_SSE __cpu_features & _CRT_SSE + + +#endif |