Added public domain versions of sin() and cos() (taken from glibc).

Not yet used, though - we probably need to rearrange the source files a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12727 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-05-18 22:19:35 +00:00
parent f789e6b332
commit 62f9753de5
3 changed files with 66 additions and 4 deletions

View File

@ -1,10 +1,12 @@
SubDir OBOS_TOP src system libroot posix math arch x86 ;
KernelMergeObject posix_math_arch_$(OBOS_ARCH).o :
<$(SOURCE_GRIST)>fabs.S
<$(SOURCE_GRIST)>frexp.c
<$(SOURCE_GRIST)>isinf.c
<$(SOURCE_GRIST)>ldexp.c
cos.S
fabs.S
frexp.c
isinf.c
ldexp.c
sin.S
:
-fPIC -DPIC
;

View File

@ -0,0 +1,30 @@
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#define FUNCTION(x) .global x; .type x,@function; x
#define FUNCTION_END(x)
#define WEAK_ALIAS(original, alias) .weak original; original = alias
FUNCTION(__cos):
fldl 4(%esp)
fcos
fnstsw %ax
testl $0x400,%eax
jnz 1f
ret
.align 4
1: fldpi
fadd %st(0)
fxch %st(1)
2: fprem1
fnstsw %ax
testl $0x400,%eax
jnz 2b
fstp %st(1)
fcos
ret
FUNCTION_END(__cos)
WEAK_ALIAS(__cos, cos)

View File

@ -0,0 +1,30 @@
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#define FUNCTION(x) .global x; .type x,@function; x
#define FUNCTION_END(x)
#define WEAK_ALIAS(original, alias) .weak original; original = alias
FUNCTION(__sin):
fldl 4(%esp)
fsin
fnstsw %ax
testl $0x400,%eax
jnz 1f
ret
.align 4
1: fldpi
fadd %st(0)
fxch %st(1)
2: fprem1
fnstsw %ax
testl $0x400,%eax
jnz 2b
fstp %st(1)
fsin
ret
FUNCTION_END(__sin)
WEAK_ALIAS(__sin, sin)