diff --git a/lib/libm/arch/i387/s_scalbn.S b/lib/libm/arch/i387/s_scalbn.S index 8287145fc1e8..c9487fe1a8d6 100644 --- a/lib/libm/arch/i387/s_scalbn.S +++ b/lib/libm/arch/i387/s_scalbn.S @@ -5,15 +5,22 @@ #include -#include "abi.h" - -RCSID("$NetBSD: s_scalbn.S,v 1.7 2003/07/26 19:25:03 salo Exp $") +RCSID("$NetBSD: s_scalbn.S,v 1.8 2006/03/21 11:35:21 drochner Exp $") ENTRY(scalbn) - XMM_TWO_ARG_DOUBLE_PROLOGUE - fildl ARG_DOUBLE_TWO - fldl ARG_DOUBLE_ONE +#ifdef __x86_64__ + movl %edi,-12(%rsp) + fildl -12(%rsp) + movsd %xmm0,-8(%rsp) + fldl -8(%rsp) fscale - fstp %st(1) /* bug fix for fp stack overflow */ - XMM_DOUBLE_EPILOGUE + fstpl -8(%rsp) + movsd -8(%rsp),%xmm0 + fstp %st(0) +#else + fildl 12(%esp) + fldl 4(%esp) + fscale + fstp %st(1) /* clean up stack */ +#endif ret diff --git a/lib/libm/arch/i387/s_scalbnf.S b/lib/libm/arch/i387/s_scalbnf.S index af08064de468..448b5bf19c34 100644 --- a/lib/libm/arch/i387/s_scalbnf.S +++ b/lib/libm/arch/i387/s_scalbnf.S @@ -5,15 +5,22 @@ #include -#include "abi.h" - -RCSID("$NetBSD: s_scalbnf.S,v 1.6 2003/07/26 19:25:03 salo Exp $") +RCSID("$NetBSD: s_scalbnf.S,v 1.7 2006/03/21 11:35:21 drochner Exp $") ENTRY(scalbnf) - XMM_TWO_ARG_FLOAT_PROLOGUE - fildl ARG_FLOAT_TWO - flds ARG_FLOAT_ONE +#ifdef __x86_64__ + movl %edi,-8(%rsp) + fildl -8(%rsp) + movss %xmm0,-4(%rsp) + flds -4(%rsp) fscale - fstp %st(1) /* bug fix for fp stack overflow */ - XMM_FLOAT_EPILOGUE + fstps -4(%rsp) + movss -4(%rsp),%xmm0 + fstp %st(0) +#else + fildl 8(%esp) + flds 4(%esp) + fscale + fstp %st(1) /* clean up stack */ +#endif ret