summaryrefslogtreecommitdiff
path: root/lib/libm/arch
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2009-04-25 11:03:36 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2009-04-25 11:03:36 +0000
commitd1631f649cf84ed52ca5a0ffcc5d44bcdcaaf19d (patch)
tree198b4bdf6229b7efdcb88cf5fc47a39337106617 /lib/libm/arch
parent885b70de22dc5d621393aa5a392f05db19b493f5 (diff)
fix scalbn, scalbnf, frexpf on amd64. don't use double arg
float/double prologue/epilogue, since the second argument is not float/double. were never working properly (always returned inf). actually, should help other math funcs (like pow) too, since they use it internally tested by kurt@; devel/boost fp regresses are working better now. ok kurt@
Diffstat (limited to 'lib/libm/arch')
-rw-r--r--lib/libm/arch/amd64/s_scalbn.S13
-rw-r--r--lib/libm/arch/amd64/s_scalbnf.S13
2 files changed, 16 insertions, 10 deletions
diff --git a/lib/libm/arch/amd64/s_scalbn.S b/lib/libm/arch/amd64/s_scalbn.S
index 7f39f2b07f8..3bdea28efaf 100644
--- a/lib/libm/arch/amd64/s_scalbn.S
+++ b/lib/libm/arch/amd64/s_scalbn.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_scalbn.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */
+/* $OpenBSD: s_scalbn.S,v 1.3 2009/04/25 11:03:35 martynas Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -9,10 +9,13 @@
#include "abi.h"
ENTRY(scalbn)
- XMM_TWO_ARG_DOUBLE_PROLOGUE
- fildl ARG_DOUBLE_TWO
- fldl ARG_DOUBLE_ONE
+ movsd %xmm0,-8(%rsp)
+ movl %edi,-12(%rsp)
+ fildl -12(%rsp)
+ fldl -8(%rsp)
fscale
fstp %st(1) /* bug fix for fp stack overflow */
- XMM_DOUBLE_EPILOGUE
+ fstpl -8(%rsp)
+ movsd -8(%rsp),%xmm0
ret
+
diff --git a/lib/libm/arch/amd64/s_scalbnf.S b/lib/libm/arch/amd64/s_scalbnf.S
index c9b69622956..b5a92e2a7ff 100644
--- a/lib/libm/arch/amd64/s_scalbnf.S
+++ b/lib/libm/arch/amd64/s_scalbnf.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_scalbnf.S,v 1.3 2009/04/21 23:02:23 martynas Exp $ */
+/* $OpenBSD: s_scalbnf.S,v 1.4 2009/04/25 11:03:35 martynas Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
@@ -12,10 +12,13 @@
ldexpf = scalbnf
ENTRY(scalbnf)
- XMM_TWO_ARG_FLOAT_PROLOGUE
- fildl ARG_FLOAT_TWO
- flds ARG_FLOAT_ONE
+ movss %xmm0,-8(%rsp)
+ movl %edi,-4(%rsp)
+ fildl -4(%rsp)
+ flds -8(%rsp)
fscale
fstp %st(1) /* bug fix for fp stack overflow */
- XMM_FLOAT_EPILOGUE
+ fstps -8(%rsp)
+ movss -8(%rsp),%xmm0
ret
+