Index: dll/ntdll/def/ntdll.spec =================================================================== --- dll/ntdll/def/ntdll.spec (revision 56958) +++ dll/ntdll/def/ntdll.spec (working copy) @@ -1292,11 +1292,11 @@ @ stdcall ZwWriteRequestData(ptr ptr long ptr long ptr) @ stdcall ZwWriteVirtualMemory(long ptr ptr long ptr) @ stdcall ZwYieldExecution() -;@ cdecl _CIcos -;@ cdecl _CIlog -;@ cdecl -private -arch=i386 _CIpow() -;@ cdecl _CIsin -;@ cdecl _CIsqrt +@ cdecl -arch=i386 _CIcos() +@ cdecl -arch=i386 _CIlog() +@ cdecl -arch=i386 _CIpow() +@ cdecl -arch=i386 _CIsin() +@ cdecl -arch=i386 _CIsqrt() @ cdecl -arch=x86_64 __C_specific_handler(ptr long ptr ptr) @ cdecl __isascii(long) @ cdecl __iscsym(long) Index: lib/sdk/crt/include/internal/math.h =================================================================== --- lib/sdk/crt/include/internal/math.h (revision 56958) +++ lib/sdk/crt/include/internal/math.h (working copy) @@ -10,3 +10,17 @@ int _isinfl (long double); /* not exported */ #endif + +#if defined(__GNUC__) +#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) : ) +#elif defined(_MSC_VER) +#define FPU_DOUBLE(var) double var; \ + __asm { fstp [var] }; __asm { fwait }; +#define FPU_DOUBLES(var1,var2) double var1,var2; \ + __asm { fstp [var1] }; __asm { fwait }; \ + __asm { fstp [var2] }; __asm { fwait }; +#endif Index: lib/sdk/crt/libcntpr.cmake =================================================================== --- lib/sdk/crt/libcntpr.cmake (revision 56958) +++ lib/sdk/crt/libcntpr.cmake (working copy) @@ -94,6 +94,11 @@ math/i386/sqrt_asm.s math/i386/tan_asm.s math/i386/ci.c + math/i386/cicos.c + math/i386/cilog.c + math/i386/cipow.c + math/i386/cisin.c + math/i386/cisqrt.c misc/i386/readcr4.S) if(NOT MSVC) list(APPEND LIBCNTPR_SOURCE except/i386/chkstk_ms.s) Index: lib/sdk/crt/math/i386/ci.c =================================================================== --- lib/sdk/crt/math/i386/ci.c (revision 56958) +++ lib/sdk/crt/math/i386/ci.c (working copy) @@ -1,48 +1,18 @@ #include #include -#if defined(__GNUC__) -#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) : ) -#elif defined(_MSC_VER) -#define FPU_DOUBLE(var) double var; \ - __asm { fstp [var] }; __asm { fwait }; -#define FPU_DOUBLES(var1,var2) double var1,var2; \ - __asm { fstp [var1] }; __asm { fwait }; \ - __asm { fstp [var2] }; __asm { fwait }; -#endif - /* * @implemented */ -double CDECL _CIsin(void) +double CDECL _CItan(void) { FPU_DOUBLE(x); - return sin(x); -} -/* - * @implemented - */ -double CDECL _CIcos(void) -{ - FPU_DOUBLE(x); - return cos(x); -} -/* - * @implemented - */ -double CDECL _CItan(void) -{ - FPU_DOUBLE(x); return tan(x); } /* * @implemented */ -double CDECL _CIsinh(void) +double CDECL _CIsinh(void) { FPU_DOUBLE(x); return sinh(x); @@ -50,7 +20,7 @@ /* * @implemented */ -double CDECL _CIcosh(void) +double CDECL _CIcosh(void) { FPU_DOUBLE(x); return cosh(x); @@ -58,7 +28,7 @@ /* * @implemented */ -double CDECL _CItanh(void) +double CDECL _CItanh(void) { FPU_DOUBLE(x); return tanh(x); @@ -66,7 +36,7 @@ /* * @implemented */ -double CDECL _CIasin(void) +double CDECL _CIasin(void) { FPU_DOUBLE(x); return asin(x); @@ -74,7 +44,7 @@ /* * @implemented */ -double CDECL _CIacos(void) +double CDECL _CIacos(void) { FPU_DOUBLE(x); return acos(x); @@ -82,7 +52,7 @@ /* * @implemented */ -double CDECL _CIatan(void) +double CDECL _CIatan(void) { FPU_DOUBLE(x); return atan(x); @@ -90,7 +60,7 @@ /* * @implemented */ -double CDECL _CIatan2(void) +double CDECL _CIatan2(void) { FPU_DOUBLES(x, y); return atan2(x, y); @@ -98,7 +68,7 @@ /* * @implemented */ -double CDECL _CIexp(void) +double CDECL _CIexp(void) { FPU_DOUBLE(x); return exp(x); @@ -106,40 +76,16 @@ /* * @implemented */ -double CDECL _CIlog(void) +double CDECL _CIlog10(void) { FPU_DOUBLE(x); - return log(x); -} -/* - * @implemented - */ -double CDECL _CIlog10(void) -{ - FPU_DOUBLE(x); return log10(x); } /* * @implemented */ -double CDECL _CIpow(void) +double CDECL _CIfmod(void) { FPU_DOUBLES(x, y); - return pow(x, y); -} -/* - * @implemented - */ -double CDECL _CIsqrt(void) -{ - FPU_DOUBLE(x); - return sqrt(x); -} -/* - * @implemented - */ -double CDECL _CIfmod(void) -{ - FPU_DOUBLES(x, y); return fmod(x, y); } Index: lib/sdk/crt/math/i386/cicos.c =================================================================== --- lib/sdk/crt/math/i386/cicos.c (revision 0) +++ lib/sdk/crt/math/i386/cicos.c (working copy) @@ -0,0 +1,11 @@ +#include +#include + +/* + * @implemented + */ +double CDECL _CIcos(void) +{ + FPU_DOUBLE(x); + return cos(x); +} Index: lib/sdk/crt/math/i386/cilog.c =================================================================== --- lib/sdk/crt/math/i386/cilog.c (revision 0) +++ lib/sdk/crt/math/i386/cilog.c (working copy) @@ -0,0 +1,11 @@ +#include +#include + +/* + * @implemented + */ +double CDECL _CIlog(void) +{ + FPU_DOUBLE(x); + return log(x); +} Index: lib/sdk/crt/math/i386/cipow.c =================================================================== --- lib/sdk/crt/math/i386/cipow.c (revision 0) +++ lib/sdk/crt/math/i386/cipow.c (working copy) @@ -0,0 +1,11 @@ +#include +#include + +/* + * @implemented + */ +double CDECL _CIpow(void) +{ + FPU_DOUBLES(x, y); + return pow(x, y); +} Index: lib/sdk/crt/math/i386/cisin.c =================================================================== --- lib/sdk/crt/math/i386/cisin.c (revision 0) +++ lib/sdk/crt/math/i386/cisin.c (working copy) @@ -0,0 +1,11 @@ +#include +#include + +/* + * @implemented + */ +double CDECL _CIsin(void) +{ + FPU_DOUBLE(x); + return sin(x); +} Index: lib/sdk/crt/math/i386/cisqrt.c =================================================================== --- lib/sdk/crt/math/i386/cisqrt.c (revision 0) +++ lib/sdk/crt/math/i386/cisqrt.c (working copy) @@ -0,0 +1,12 @@ +#include +#include + +/* + * @implemented + */ +double CDECL _CIsqrt(void) +{ + FPU_DOUBLE(x); + return sqrt(x); +} + Index: lib/sdk/crt/msvcrtex.cmake =================================================================== --- lib/sdk/crt/msvcrtex.cmake (revision 56958) +++ lib/sdk/crt/msvcrtex.cmake (working copy) @@ -50,6 +50,11 @@ except/i386/chkstk_asm.s except/i386/chkstk_ms.s math/i386/ci.c + math/i386/cicos.c + math/i386/cilog.c + math/i386/cipow.c + math/i386/cisin.c + math/i386/cisqrt.c math/i386/ftol2_asm.s math/i386/alldiv_asm.s) elseif(ARCH MATCHES amd64)