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:
parent
f789e6b332
commit
62f9753de5
@ -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
|
||||
;
|
||||
|
30
src/system/libroot/posix/math/arch/x86/cos.S
Normal file
30
src/system/libroot/posix/math/arch/x86/cos.S
Normal 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)
|
30
src/system/libroot/posix/math/arch/x86/sin.S
Normal file
30
src/system/libroot/posix/math/arch/x86/sin.S
Normal 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)
|
Loading…
Reference in New Issue
Block a user