The second argument is not a float, so the "abi.h" abstraction
authorPeter Avalos <pavalos@dragonflybsd.org>
Sat, 16 Jun 2007 23:53:00 +0000 (23:53 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sat, 16 Jun 2007 23:53:00 +0000 (23:53 +0000)
doesn't work.
Open-code the argument handling instead.

Obtained-from:  NetBSD

lib/libm/arch/i386/s_scalbn.S
lib/libm/arch/i386/s_scalbnf.S

index e8b9c22..29f4d74 100644 (file)
@@ -2,19 +2,26 @@
  * Written by J.T. Conklin <jtc@NetBSD.org>.
  * Public domain.
  *
- * $NetBSD: s_scalbn.S,v 1.7 2003/07/26 19:25:03 salo Exp $
- * $DragonFly: src/lib/libm/arch/i386/s_scalbn.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
+ * $NetBSD: s_scalbn.S,v 1.8 2006/03/21 11:35:21 drochner Exp $
+ * $DragonFly: src/lib/libm/arch/i386/s_scalbn.S,v 1.2 2007/06/16 23:53:00 pavalos Exp $
  */
 
 #include <machine/asm.h>
 
-#include "abi.h"
-
 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
+       fstpl -8(%rsp)
+       movsd -8(%rsp),%xmm0
+       fstp %st(0)
+#else
+       fildl 12(%esp)
+       fldl 4(%esp)
        fscale
-       fstp    %st(1)          /* bug fix for fp stack overflow */
-       XMM_DOUBLE_EPILOGUE
+       fstp %st(1)             /* clean up stack */
+#endif
        ret
index 421960d..8e30c94 100644 (file)
@@ -2,19 +2,26 @@
  * Written by J.T. Conklin <jtc@NetBSD.org>.
  * Public domain.
  *
- * $NetBSD: s_scalbnf.S,v 1.6 2003/07/26 19:25:03 salo Exp $
- * $DragonFly: src/lib/libm/arch/i386/s_scalbnf.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
+ * $NetBSD: s_scalbnf.S,v 1.7 2006/03/21 11:35:21 drochner Exp $
+ * $DragonFly: src/lib/libm/arch/i386/s_scalbnf.S,v 1.2 2007/06/16 23:53:00 pavalos Exp $
  */
 
 #include <machine/asm.h>
 
-#include "abi.h"
-
 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
+       fstps -4(%rsp)
+       movss -4(%rsp),%xmm0
+       fstp %st(0)
+#else
+       fildl 8(%esp)
+       flds 4(%esp)
        fscale
-       fstp    %st(1)          /* bug fix for fp stack overflow */
-       XMM_FLOAT_EPILOGUE
+       fstp %st(1)             /* clean up stack */
+#endif
        ret