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:
@@ -1,10 +1,12 @@
|
|||||||
SubDir OBOS_TOP src system libroot posix math arch x86 ;
|
SubDir OBOS_TOP src system libroot posix math arch x86 ;
|
||||||
|
|
||||||
KernelMergeObject posix_math_arch_$(OBOS_ARCH).o :
|
KernelMergeObject posix_math_arch_$(OBOS_ARCH).o :
|
||||||
<$(SOURCE_GRIST)>fabs.S
|
cos.S
|
||||||
<$(SOURCE_GRIST)>frexp.c
|
fabs.S
|
||||||
<$(SOURCE_GRIST)>isinf.c
|
frexp.c
|
||||||
<$(SOURCE_GRIST)>ldexp.c
|
isinf.c
|
||||||
|
ldexp.c
|
||||||
|
sin.S
|
||||||
:
|
:
|
||||||
-fPIC -DPIC
|
-fPIC -DPIC
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -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)
|
||||||
Reference in New Issue
Block a user