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)