diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2002-04-16 09:02:35 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2002-04-16 09:02:35 +0000 |
commit | 7211acadc0a5b3d1a341e91a6c1eff8f993b81a0 (patch) | |
tree | e008603b97b5bca7a55d3e4bd4ca03829e2d53f8 /winsup/mingw/crt1.c | |
parent | c3b9aa576b88bec984dd3e7b7a20421d7ea4e173 (diff) | |
download | newlib-7211acadc0a5b3d1a341e91a6c1eff8f993b81a0.zip newlib-7211acadc0a5b3d1a341e91a6c1eff8f993b81a0.tar.gz newlib-7211acadc0a5b3d1a341e91a6c1eff8f993b81a0.tar.bz2 |
* CRT_fp8.c: New file.
* CRT_fp10.c: New file.
* crt1.c (__CRT_PC) Declare.
(__CRT_fesetenv): New static function, using _CRT_PC.
(__mingw_CRTStartup):Use __CRT_fesetenv instead of _fpreset.
(_gnu_exception_handler): Likewise.
* Makefile.in (CRT0S): Add CRT_fp10.o.
(MINGW_OBJS): Add CRT_fp8.o.
(SRCDIST_FILES): Add CRT_fp8.c, CRT_fp10.c.
Add CRT_fp8.o, CRT_fp10.o dependancies.
* include/float.h (_fpreset): Expand comment.
* include/fenv.h (FE_PC64_ENV): New define for Intel x87
(extended precison) environmemt.
(FE_PC53_ENV): New define for MSVCRT default environmemt.
(FE_DFL_ENV): Define as FE_PC53_ENV.
* mingwex/fesetenv.c: Use FE_PC53_ENV, FE_PC64_ENV to determine
precision control for default environment.
* include/math.h: Fix long comment line.
* profile/configure.in (CRT0S): Set to both gcrt1.o and gcrt2.o
for mingw.
* profile/configure: Regenerate.
Diffstat (limited to 'winsup/mingw/crt1.c')
-rw-r--r-- | winsup/mingw/crt1.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/winsup/mingw/crt1.c b/winsup/mingw/crt1.c index f91f1da..b572c4f 100644 --- a/winsup/mingw/crt1.c +++ b/winsup/mingw/crt1.c @@ -61,6 +61,21 @@ __MINGW_IMPORT void __set_app_type(int); */ extern unsigned int _CRT_fmode; +/* + * If the user links in CRT_fp10.o or a different object + * defining __CRT_PC this will override default FP precison set + * in CRT_fp8.o in libmingw.a. + */ +extern unsigned int __CRT_PC; +static inline void +__CRT_fesetenv (void) +{ + if (__CRT_PC == 8) + _fpreset(); + else + __asm__ volatile ("fninit"); +} + static void _mingw32_init_fmode () { @@ -136,7 +151,7 @@ _gnu_exception_handler (EXCEPTION_POINTERS * exception_data) { signal (SIGFPE, SIG_IGN); if (reset_fpu) - _fpreset (); + __CRT_fesetenv(); action = EXCEPTION_CONTINUE_EXECUTION; } else if (old_handler != SIG_DFL) @@ -172,7 +187,7 @@ __mingw_CRTStartup () /* * Initialize floating point unit. */ - _fpreset (); /* Supplied by the runtime library. */ + __CRT_fesetenv(); /* * Set up __argc, __argv and _environ. @@ -231,4 +246,3 @@ WinMainCRTStartup () #endif __mingw_CRTStartup (); } - |