diff --git a/src/system/libroot/posix/math/arch/x86/Jamfile b/src/system/libroot/posix/math/arch/x86/Jamfile index 93ed03e951..5096fdc836 100644 --- a/src/system/libroot/posix/math/arch/x86/Jamfile +++ b/src/system/libroot/posix/math/arch/x86/Jamfile @@ -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 ; diff --git a/src/system/libroot/posix/math/arch/x86/cos.S b/src/system/libroot/posix/math/arch/x86/cos.S new file mode 100644 index 0000000000..6681d35d83 --- /dev/null +++ b/src/system/libroot/posix/math/arch/x86/cos.S @@ -0,0 +1,30 @@ +/* + * Written by J.T. Conklin . + * 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) diff --git a/src/system/libroot/posix/math/arch/x86/sin.S b/src/system/libroot/posix/math/arch/x86/sin.S new file mode 100644 index 0000000000..f9340245a6 --- /dev/null +++ b/src/system/libroot/posix/math/arch/x86/sin.S @@ -0,0 +1,30 @@ +/* + * Written by J.T. Conklin . + * 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)