Author: fireball Date: Fri Aug 15 13:24:11 2008 New Revision: 35357
URL: http://svn.reactos.org/svn/reactos?rev=35357&view=rev Log: Gregor Schneider grschneider@gmail.com - Floating point values are not passed directly, but using the stack. Ref: Wine code and http://en.wikibooks.org/wiki/Reverse_Engineering/Floating_Point_Numbers code. - mem/i386/memchr_asm.s: don't loop if given size is 0. - Python test_builtin passes all 50 tests now. See issue #1255 for more details.
Modified: trunk/reactos/lib/sdk/crt/math/stubs.c trunk/reactos/lib/sdk/crt/mem/i386/memchr_asm.s
Modified: trunk/reactos/lib/sdk/crt/math/stubs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/math/stubs.c?re... ============================================================================== --- trunk/reactos/lib/sdk/crt/math/stubs.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/math/stubs.c [iso-8859-1] Fri Aug 15 13:24:11 2008 @@ -1,134 +1,138 @@ #include <precomp.h> #include <math.h>
-double _CIsin(double x); -double _CIcos(double x); -double _CItan(double x); -double _CIsinh(double x); -double _CIcosh(double x); -double _CItanh(double x); -double _CIasin(double x); -double _CIacos(double x); -double _CIatan(double x); -double _CIatan2(double y, double x); -double _CIexp(double x); -double _CIlog(double x); -double _CIlog10(double x); -double _CIpow(double x, double y); -double _CIsqrt(double x); -double _CIfmod(double x, double y); - - -/* - * @implemented - */ -double _CIsin(double x) -{ +#define FPU_DOUBLE(var) double var; \ + __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : ) +#define FPU_DOUBLES(var1,var2) double var1,var2; \ + __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var2) : ); \ + __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var1) : ) + +/* + * @implemented + */ +double CDECL _CIsin(void) +{ + FPU_DOUBLE(x); return sin(x); } /* * @implemented */ -double _CIcos(double x) -{ +double CDECL _CIcos(void) +{ + FPU_DOUBLE(x); return cos(x); } /* * @implemented */ -double _CItan(double x) -{ +double CDECL _CItan(void) +{ + FPU_DOUBLE(x); return tan(x); } /* * @implemented */ -double _CIsinh(double x) -{ +double CDECL _CIsinh(void) +{ + FPU_DOUBLE(x); return sinh(x); } /* * @implemented */ -double _CIcosh(double x) -{ +double CDECL _CIcosh(void) +{ + FPU_DOUBLE(x); return cosh(x); } /* * @implemented */ -double _CItanh(double x) -{ +double CDECL _CItanh(void) +{ + FPU_DOUBLE(x); return tanh(x); } /* * @implemented */ -double _CIasin(double x) -{ +double CDECL _CIasin(void) +{ + FPU_DOUBLE(x); return asin(x); } /* * @implemented */ -double _CIacos(double x) -{ +double CDECL _CIacos(void) +{ + FPU_DOUBLE(x); return acos(x); } /* * @implemented */ -double _CIatan(double x) -{ +double CDECL _CIatan(void) +{ + FPU_DOUBLE(x); return atan(x); } /* * @implemented */ -double _CIatan2(double y, double x) -{ - return atan2(y, x); -} -/* - * @implemented - */ -double _CIexp(double x) -{ +double CDECL _CIatan2(void) +{ + FPU_DOUBLES(x, y); + return atan2(x, y); +} +/* + * @implemented + */ +double CDECL _CIexp(void) +{ + FPU_DOUBLE(x); return exp(x); } /* * @implemented */ -double _CIlog(double x) -{ +double CDECL _CIlog(void) +{ + FPU_DOUBLE(x); return log(x); } /* * @implemented */ -double _CIlog10(double x) -{ +double CDECL _CIlog10(void) +{ + FPU_DOUBLE(x); return log10(x); } /* * @implemented */ -double _CIpow(double x, double y) -{ +double CDECL _CIpow(void) +{ + FPU_DOUBLES(x, y); return pow(x, y); } /* * @implemented */ -double _CIsqrt(double x) -{ +double CDECL _CIsqrt(void) +{ + FPU_DOUBLE(x); return sqrt(x); } /* * @implemented */ -double _CIfmod(double x, double y) -{ +double CDECL _CIfmod(void) +{ + FPU_DOUBLES(x, y); return fmod(x, y); }
Modified: trunk/reactos/lib/sdk/crt/mem/i386/memchr_asm.s URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/mem/i386/memchr... ============================================================================== --- trunk/reactos/lib/sdk/crt/mem/i386/memchr_asm.s [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/mem/i386/memchr_asm.s [iso-8859-1] Fri Aug 15 13:24:11 2008 @@ -2,7 +2,7 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: lib/string/i386/memchr.s + * FILE: lib/sdk/crt/mem/i386/memchr.s */
/* @@ -19,13 +19,14 @@ mov 0xc(%ebp),%eax mov 0x10(%ebp),%ecx cld + jecxz .Lnotfound repne scasb - je .L1 + je .Lfound +.Lnotfound: mov $1,%edi -.L1: +.Lfound: mov %edi,%eax dec %eax pop %edi leave ret -