mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 20:34:59 +00:00
- Move x86-specific code, which was accidentally committed to the generic part of crt library to arch specific area.
- Include x86-specific _CI* functions into libcntpr. svn path=/trunk/; revision=35368
This commit is contained in:
parent
fae32f4a71
commit
fb67b668d9
4 changed files with 173 additions and 38 deletions
|
@ -104,6 +104,7 @@
|
||||||
<if property="ARCH" value="i386">
|
<if property="ARCH" value="i386">
|
||||||
<directory name="i386">
|
<directory name="i386">
|
||||||
<file>atan2.c</file>
|
<file>atan2.c</file>
|
||||||
|
<file>ci.c</file>
|
||||||
<file>exp.c</file>
|
<file>exp.c</file>
|
||||||
<file>fmod.c</file>
|
<file>fmod.c</file>
|
||||||
<file>ldexp.c</file>
|
<file>ldexp.c</file>
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
<file>aulldvrm_asm.s</file>
|
<file>aulldvrm_asm.s</file>
|
||||||
<file>aullrem_asm.s</file>
|
<file>aullrem_asm.s</file>
|
||||||
<file>aullshr_asm.s</file>
|
<file>aullshr_asm.s</file>
|
||||||
|
<file>ci.c</file>
|
||||||
<file>ceil_asm.s</file>
|
<file>ceil_asm.s</file>
|
||||||
<file>cos_asm.s</file>
|
<file>cos_asm.s</file>
|
||||||
<file>fabs_asm.s</file>
|
<file>fabs_asm.s</file>
|
||||||
|
|
137
reactos/lib/sdk/crt/math/i386/ci.c
Normal file
137
reactos/lib/sdk/crt/math/i386/ci.c
Normal file
|
@ -0,0 +1,137 @@
|
||||||
|
#include <precomp.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#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 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)
|
||||||
|
{
|
||||||
|
FPU_DOUBLE(x);
|
||||||
|
return sinh(x);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
double CDECL _CIcosh(void)
|
||||||
|
{
|
||||||
|
FPU_DOUBLE(x);
|
||||||
|
return cosh(x);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
double CDECL _CItanh(void)
|
||||||
|
{
|
||||||
|
FPU_DOUBLE(x);
|
||||||
|
return tanh(x);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
double CDECL _CIasin(void)
|
||||||
|
{
|
||||||
|
FPU_DOUBLE(x);
|
||||||
|
return asin(x);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
double CDECL _CIacos(void)
|
||||||
|
{
|
||||||
|
FPU_DOUBLE(x);
|
||||||
|
return acos(x);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
double CDECL _CIatan(void)
|
||||||
|
{
|
||||||
|
FPU_DOUBLE(x);
|
||||||
|
return atan(x);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
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 CDECL _CIlog(void)
|
||||||
|
{
|
||||||
|
FPU_DOUBLE(x);
|
||||||
|
return log(x);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
double CDECL _CIlog10(void)
|
||||||
|
{
|
||||||
|
FPU_DOUBLE(x);
|
||||||
|
return log10(x);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
double CDECL _CIpow(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);
|
||||||
|
}
|
|
@ -1,138 +1,134 @@
|
||||||
#include <precomp.h>
|
#include <precomp.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define FPU_DOUBLE(var) double var; \
|
double CDECL _CIsin(double x);
|
||||||
__asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : )
|
double CDECL _CIcos(double x);
|
||||||
#define FPU_DOUBLES(var1,var2) double var1,var2; \
|
double CDECL _CItan(double x);
|
||||||
__asm__ __volatile__( "fstpl %0;fwait" : "=m" (var2) : ); \
|
double CDECL _CIsinh(double x);
|
||||||
__asm__ __volatile__( "fstpl %0;fwait" : "=m" (var1) : )
|
double CDECL _CIcosh(double x);
|
||||||
|
double CDECL _CItanh(double x);
|
||||||
|
double CDECL _CIasin(double x);
|
||||||
|
double CDECL _CIacos(double x);
|
||||||
|
double CDECL _CIatan(double x);
|
||||||
|
double CDECL _CIatan2(double y, double x);
|
||||||
|
double CDECL _CIexp(double x);
|
||||||
|
double CDECL _CIlog(double x);
|
||||||
|
double CDECL _CIlog10(double x);
|
||||||
|
double CDECL _CIpow(double x, double y);
|
||||||
|
double CDECL _CIsqrt(double x);
|
||||||
|
double CDECL _CIfmod(double x, double y);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIsin(void)
|
double CDECL _CIsin(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return sin(x);
|
return sin(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIcos(void)
|
double CDECL _CIcos(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return cos(x);
|
return cos(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CItan(void)
|
double CDECL _CItan(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return tan(x);
|
return tan(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIsinh(void)
|
double CDECL _CIsinh(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return sinh(x);
|
return sinh(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIcosh(void)
|
double CDECL _CIcosh(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return cosh(x);
|
return cosh(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CItanh(void)
|
double CDECL _CItanh(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return tanh(x);
|
return tanh(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIasin(void)
|
double CDECL _CIasin(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return asin(x);
|
return asin(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIacos(void)
|
double CDECL _CIacos(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return acos(x);
|
return acos(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIatan(void)
|
double CDECL _CIatan(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return atan(x);
|
return atan(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIatan2(void)
|
double CDECL _CIatan2(double x, double y)
|
||||||
{
|
{
|
||||||
FPU_DOUBLES(x, y);
|
return atan2(y, x);
|
||||||
return atan2(x, y);
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIexp(void)
|
double CDECL _CIexp(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return exp(x);
|
return exp(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIlog(void)
|
double CDECL _CIlog(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return log(x);
|
return log(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIlog10(void)
|
double CDECL _CIlog10(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return log10(x);
|
return log10(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIpow(void)
|
double CDECL _CIpow(double x, double y)
|
||||||
{
|
{
|
||||||
FPU_DOUBLES(x, y);
|
|
||||||
return pow(x, y);
|
return pow(x, y);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIsqrt(void)
|
double CDECL _CIsqrt(double x)
|
||||||
{
|
{
|
||||||
FPU_DOUBLE(x);
|
|
||||||
return sqrt(x);
|
return sqrt(x);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
double CDECL _CIfmod(void)
|
double CDECL _CIfmod(double x, double y)
|
||||||
{
|
{
|
||||||
FPU_DOUBLES(x, y);
|
|
||||||
return fmod(x, y);
|
return fmod(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue