Author: sginsberg
Date: Fri Aug 7 11:36:53 2009
New Revision: 42458
URL:
http://svn.reactos.org/svn/reactos?rev=42458&view=rev
Log:
- Add inlined assembly for MSVC to _clearfp, _control87, _fpreset, _logb and _statusfp,
move fpreset into arch-specific directory and remove x86 #ifdefs from the code.
- Disable warning C4733 for __wine_push_frame and __wine_pop_frame
Added:
trunk/reactos/lib/sdk/crt/float/i386/fpreset.c (with props)
Removed:
trunk/reactos/lib/sdk/crt/float/fpreset.c
Modified:
trunk/reactos/lib/sdk/crt/crt.rbuild
trunk/reactos/lib/sdk/crt/float/i386/clearfp.c
trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c
trunk/reactos/lib/sdk/crt/float/i386/logb.c
trunk/reactos/lib/sdk/crt/float/i386/statfp.c
trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h
Modified: trunk/reactos/lib/sdk/crt/crt.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/crt.rbuild?rev…
==============================================================================
--- trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] Fri Aug 7 11:36:53 2009
@@ -81,7 +81,6 @@
<file>copysign.c</file>
<file>fpclass.c</file>
<file>fpecode.c</file>
- <file>fpreset.c</file>
<file>isnan.c</file>
<file>nafter.c</file>
<file>scalb.c</file>
@@ -89,6 +88,7 @@
<directory name="i386">
<file>clearfp.c</file>
<file>cntrlfp.c</file>
+ <file>fpreset.c</file>
<file>logb.c</file>
<file>statfp.c</file>
</directory>
@@ -97,6 +97,7 @@
<directory name="i386">
<file>clearfp.c</file>
<file>cntrlfp.c</file>
+ <file>fpreset.c</file>
<file>logb.c</file>
<file>statfp.c</file>
</directory>
Removed: trunk/reactos/lib/sdk/crt/float/fpreset.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/float/fpreset.…
==============================================================================
--- trunk/reactos/lib/sdk/crt/float/fpreset.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/float/fpreset.c (removed)
@@ -1,23 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
- * FILE: lib/crt/??????
- * PURPOSE: Unknown
- * PROGRAMER: Unknown
- * UPDATE HISTORY:
- * 25/11/05: Added license header
- */
-
-#include <precomp.h>
-
-/*********************************************************************
- * _fpreset (MSVCRT.@)
- */
-void CDECL _fpreset(void)
-{
-#if defined(__GNUC__) && defined(__i386__)
- __asm__ __volatile__( "fninit" );
-#else
- FIXME(":Not Implemented!\n");
-#endif
-}
Modified: trunk/reactos/lib/sdk/crt/float/i386/clearfp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/float/i386/cle…
==============================================================================
--- trunk/reactos/lib/sdk/crt/float/i386/clearfp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/float/i386/clearfp.c [iso-8859-1] Fri Aug 7 11:36:53 2009
@@ -18,10 +18,10 @@
unsigned int CDECL _clearfp(void)
{
unsigned int retVal = _statusfp();
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__)
__asm__ __volatile__( "fnclex" );
#else
- FIXME(":Not Implemented\n");
+ __asm fnclex;
#endif
return retVal;
}
Modified: trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/float/i386/cnt…
==============================================================================
--- trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c [iso-8859-1] Fri Aug 7 11:36:53 2009
@@ -29,12 +29,7 @@
unsigned int CDECL _controlfp(unsigned int newval, unsigned int mask)
{
-#ifdef __i386__
return _control87( newval, mask & ~_EM_DENORMAL );
-#else
- FIXME(":Not Implemented!\n");
- return 0;
-#endif
}
/*********************************************************************
@@ -42,14 +37,17 @@
*/
unsigned int CDECL _control87(unsigned int newval, unsigned int mask)
{
-#if defined(__GNUC__) && defined(__i386__)
unsigned int fpword = 0;
unsigned int flags = 0;
TRACE("(%08x, %08x): Called\n", newval, mask);
/* Get fp control word */
+#if defined(__GNUC__)
__asm__ __volatile__( "fstcw %0" : "=m" (fpword) : );
+#else
+ __asm fstcw [fpword];
+#endif
TRACE("Control word before : %08x\n", fpword);
@@ -98,11 +96,11 @@
TRACE("Control word after : %08x\n", fpword);
/* Put fp control word */
+#if defined(__GNUC__)
__asm__ __volatile__( "fldcw %0" : : "m" (fpword) );
+#else
+ __asm fldcw [fpword];
+#endif
return flags;
-#else
- FIXME(":Not Implemented!\n");
- return 0;
-#endif
}
Added: trunk/reactos/lib/sdk/crt/float/i386/fpreset.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/float/i386/fpr…
==============================================================================
--- trunk/reactos/lib/sdk/crt/float/i386/fpreset.c (added)
+++ trunk/reactos/lib/sdk/crt/float/i386/fpreset.c [iso-8859-1] Fri Aug 7 11:36:53 2009
@@ -1,0 +1,23 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * FILE: lib/crt/??????
+ * PURPOSE: Unknown
+ * PROGRAMER: Unknown
+ * UPDATE HISTORY:
+ * 25/11/05: Added license header
+ */
+
+#include <precomp.h>
+
+/*********************************************************************
+ * _fpreset (MSVCRT.@)
+ */
+void CDECL _fpreset(void)
+{
+#if defined(__GNUC__)
+ __asm__ __volatile__( "fninit" );
+#else
+ __asm fninit;
+#endif
+}
Propchange: trunk/reactos/lib/sdk/crt/float/i386/fpreset.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/lib/sdk/crt/float/i386/logb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/float/i386/log…
==============================================================================
--- trunk/reactos/lib/sdk/crt/float/i386/logb.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/float/i386/logb.c [iso-8859-1] Fri Aug 7 11:36:53 2009
@@ -29,6 +29,10 @@
("fxtract\n\t"
: "=t" (__junk), "=u" (__val) : "0" (__x));
#else
+ __asm fld [__x];
+ __asm fxtract;
+ __asm fstp st(0);
+ __asm fstp [__val];
#endif /*__GNUC__*/
return __val;
}
Modified: trunk/reactos/lib/sdk/crt/float/i386/statfp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/float/i386/sta…
==============================================================================
--- trunk/reactos/lib/sdk/crt/float/i386/statfp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/float/i386/statfp.c [iso-8859-1] Fri Aug 7 11:36:53 2009
@@ -24,19 +24,18 @@
*/
unsigned int CDECL _statusfp(void)
{
- unsigned int retVal = 0;
-#if defined(__GNUC__) && defined(__i386__)
+ unsigned int retVal = 0;
unsigned int fpword;
-
+#if defined(__GNUC__)
__asm__ __volatile__( "fstsw %0" : "=m" (fpword) : );
+#else
+ __asm fstsw [fpword];
+#endif
if (fpword & 0x1) retVal |= _SW_INVALID;
if (fpword & 0x2) retVal |= _SW_DENORMAL;
if (fpword & 0x4) retVal |= _SW_ZERODIVIDE;
if (fpword & 0x8) retVal |= _SW_OVERFLOW;
if (fpword & 0x10) retVal |= _SW_UNDERFLOW;
if (fpword & 0x20) retVal |= _SW_INEXACT;
-#else
- FIXME(":Not implemented!\n");
-#endif
return retVal;
}
Modified: trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/include/intern…
==============================================================================
--- trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h [iso-8859-1] Fri Aug 7
11:36:53 2009
@@ -53,6 +53,12 @@
#define EH_NESTED_CALL 0x10
#ifndef _M_ARM
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4733)
+#endif
+
static inline EXCEPTION_REGISTRATION_RECORD *__wine_push_frame(
EXCEPTION_REGISTRATION_RECORD *frame )
{
frame->Next = (struct _EXCEPTION_REGISTRATION_RECORD *)__readfsdword(0);
@@ -65,6 +71,11 @@
__writefsdword(0, (unsigned long)frame->Next);
return frame->Next;
}
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
#endif
#define __TRY _SEH2_TRY