From fe9bc5ae27fafe0d47743ef47f4679173a2c78cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 19 May 2005 14:13:22 +0000 Subject: [PATCH] Added sqrt() and sqrtf() assembly versions. Still they are not yet really used. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12731 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/math/arch/x86/Jamfile | 2 ++ src/system/libroot/posix/math/arch/x86/sqrt.S | 16 ++++++++++++++++ src/system/libroot/posix/math/arch/x86/sqrtf.S | 16 ++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 src/system/libroot/posix/math/arch/x86/sqrt.S create mode 100644 src/system/libroot/posix/math/arch/x86/sqrtf.S diff --git a/src/system/libroot/posix/math/arch/x86/Jamfile b/src/system/libroot/posix/math/arch/x86/Jamfile index 5096fdc836..48b18a8041 100644 --- a/src/system/libroot/posix/math/arch/x86/Jamfile +++ b/src/system/libroot/posix/math/arch/x86/Jamfile @@ -7,6 +7,8 @@ KernelMergeObject posix_math_arch_$(OBOS_ARCH).o : isinf.c ldexp.c sin.S + sqrt.S + sqrtf.S : -fPIC -DPIC ; diff --git a/src/system/libroot/posix/math/arch/x86/sqrt.S b/src/system/libroot/posix/math/arch/x86/sqrt.S new file mode 100644 index 0000000000..c4a043be47 --- /dev/null +++ b/src/system/libroot/posix/math/arch/x86/sqrt.S @@ -0,0 +1,16 @@ +/* + * 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(__sqrt): + fldl 4(%esp) + fsqrt + ret +FUNCTION_END(__sqrt) + +WEAK_ALIAS(__sqrt, sqrt) diff --git a/src/system/libroot/posix/math/arch/x86/sqrtf.S b/src/system/libroot/posix/math/arch/x86/sqrtf.S new file mode 100644 index 0000000000..2af5d4edd8 --- /dev/null +++ b/src/system/libroot/posix/math/arch/x86/sqrtf.S @@ -0,0 +1,16 @@ +/* + * 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(__sqrtf): + flds 4(%esp) + fsqrt + ret +FUNCTION_END(__sqrtf) + +WEAK_ALIAS(__sqrtf, sqrtf)