summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2013-07-15 04:03:42 +0000
committerMarc Espie <espie@cvs.openbsd.org>2013-07-15 04:03:42 +0000
commit7f1eb6e5975a8af288abec63a1fae1e761f5c1b0 (patch)
treea410dac9bc15c7bd33e4df3e3d322d04367dcfa0
parent5f0da40f60dea8c8754c5c63abc1c791ceb481ac (diff)
add some missing asm functions to vax: long double as aliases to double,
and float functions by cvtfd/cvtdf (like in netbsd) scalbnf will have to wait, as it's more complicated... brings vax in line with the rest. okay miod@/martynas@
-rw-r--r--lib/libm/arch/vax/n_atan2.S8
-rw-r--r--lib/libm/arch/vax/n_cbrt.S11
-rw-r--r--lib/libm/arch/vax/n_hypot.S12
-rw-r--r--lib/libm/arch/vax/n_sincos.S14
-rw-r--r--lib/libm/arch/vax/n_sqrt.S8
-rw-r--r--lib/libm/arch/vax/n_tan.S8
6 files changed, 51 insertions, 10 deletions
diff --git a/lib/libm/arch/vax/n_atan2.S b/lib/libm/arch/vax/n_atan2.S
index 287848aa5a1..19281bc8918 100644
--- a/lib/libm/arch/vax/n_atan2.S
+++ b/lib/libm/arch/vax/n_atan2.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: n_atan2.S,v 1.8 2013/07/05 21:10:50 miod Exp $ */
+/* $OpenBSD: n_atan2.S,v 1.9 2013/07/15 04:03:41 espie Exp $ */
/* $NetBSD: n_atan2.S,v 1.1 1995/10/10 23:40:25 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -73,6 +73,12 @@
* atan2(y,x) returns the exact ARG(x+iy) nearly rounded.
*/
+ENTRY(atan2f, 0)
+ cvtfd 4(%ap),-(%sp)
+ calls $2,_C_LABEL(atan2)
+ cvtdf %r0,%r0
+ ret
+
STRONG_ALIAS(atan2l,atan2)
ENTRY(atan2, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
movq 4(%ap),%r2 # r2 = y
diff --git a/lib/libm/arch/vax/n_cbrt.S b/lib/libm/arch/vax/n_cbrt.S
index d5669952618..6e84d637660 100644
--- a/lib/libm/arch/vax/n_cbrt.S
+++ b/lib/libm/arch/vax/n_cbrt.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: n_cbrt.S,v 1.5 2013/07/05 21:10:50 miod Exp $ */
+/* $OpenBSD: n_cbrt.S,v 1.6 2013/07/15 04:03:41 espie Exp $ */
/* $NetBSD: n_cbrt.S,v 1.1 1995/10/10 23:40:26 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -40,8 +40,13 @@
* Revised and tested by K.C. Ng, 5/2/85
* Max error less than 0.667 ulps (unit in the last places)
*/
- .text
- _ALIGN_TEXT
+ENTRY(cbrtf, 0)
+ cvtfd 4(%ap),-(%sp)
+ calls $2,_C_LABEL(cbrt)
+ cvtdf %r0,%r0
+ ret
+
+STRONG_ALIAS(cbrtl,cbrt)
ENTRY(cbrt, R2|R3|R4|R5|R6|R7)
movq 4(%ap),%r0 # r0 = argument x
bicw3 $0x807f,%r0,%r2 # biased exponent of x
diff --git a/lib/libm/arch/vax/n_hypot.S b/lib/libm/arch/vax/n_hypot.S
index 72f5d773de5..fde36eb9166 100644
--- a/lib/libm/arch/vax/n_hypot.S
+++ b/lib/libm/arch/vax/n_hypot.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: n_hypot.S,v 1.2 2013/07/05 21:10:50 miod Exp $ */
+/* $OpenBSD: n_hypot.S,v 1.3 2013/07/15 04:03:41 espie Exp $ */
/* $NetBSD: n_cabs.S,v 1.1 1995/10/10 23:40:26 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -43,8 +43,14 @@
*/
/* entry for c functions cabs and hypot */
- .text
- _ALIGN_TEXT
+ENTRY(hypotf, 0)
+ cvtfd 4(%ap),-(%sp)
+ calls $2,_C_LABEL(hypot)
+ cvtdf %r0,%r0
+ ret
+
+STRONG_ALIAS(hypotl, hypot)
+
ENTRY(hypot, 0x8000|R2|R3|R4|R5|R6) # enable floating overflow
movq 4(%ap),%r0 # r0:1 = x
movq 12(%ap),%r2 # r2:3 = y
diff --git a/lib/libm/arch/vax/n_sincos.S b/lib/libm/arch/vax/n_sincos.S
index 00e2831e86d..5c0e89930cf 100644
--- a/lib/libm/arch/vax/n_sincos.S
+++ b/lib/libm/arch/vax/n_sincos.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: n_sincos.S,v 1.9 2013/07/05 21:10:50 miod Exp $ */
+/* $OpenBSD: n_sincos.S,v 1.10 2013/07/15 04:03:41 espie Exp $ */
/* $NetBSD: n_sincos.S,v 1.1 1995/10/10 23:40:28 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -48,6 +48,12 @@
* S. McDonald, April 4, 1985
*/
+ENTRY(sinf, 0)
+ cvtfd 4(%ap),-(%sp)
+ calls $2,_C_LABEL(sin)
+ cvtdf %r0,%r0
+ ret
+
STRONG_ALIAS(sinl,sin)
ENTRY(sin, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
movq 4(%ap),%r0
@@ -78,6 +84,12 @@ ENTRY(sin, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
* S. McDonald, April 4, 1985
*/
+ENTRY(cosf, 0)
+ cvtfd 4(%ap),-(%sp)
+ calls $2,_C_LABEL(cos)
+ cvtdf %r0,%r0
+ ret
+
STRONG_ALIAS(cosl,cos)
ENTRY(cos, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
movq 4(%ap),%r0
diff --git a/lib/libm/arch/vax/n_sqrt.S b/lib/libm/arch/vax/n_sqrt.S
index 60f666da190..666a818f096 100644
--- a/lib/libm/arch/vax/n_sqrt.S
+++ b/lib/libm/arch/vax/n_sqrt.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: n_sqrt.S,v 1.10 2013/07/05 21:10:50 miod Exp $ */
+/* $OpenBSD: n_sqrt.S,v 1.11 2013/07/15 04:03:41 espie Exp $ */
/* $NetBSD: n_sqrt.S,v 1.1 1995/10/10 23:40:29 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -45,6 +45,12 @@
* entry points: sqrt double arg is on the stack
*/
+ENTRY(sqrtf, 0)
+ cvtfd 4(%ap),-(%sp)
+ calls $2,_C_LABEL(sqrt)
+ cvtdf %r0,%r0
+ ret
+
STRONG_ALIAS(sqrtl,sqrt)
ENTRY(sqrt, R2|R3|R4|R5)
movq 4(%ap),%r0
diff --git a/lib/libm/arch/vax/n_tan.S b/lib/libm/arch/vax/n_tan.S
index aedb143b0b6..c71690843d8 100644
--- a/lib/libm/arch/vax/n_tan.S
+++ b/lib/libm/arch/vax/n_tan.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: n_tan.S,v 1.9 2013/07/05 21:10:50 miod Exp $ */
+/* $OpenBSD: n_tan.S,v 1.10 2013/07/15 04:03:41 espie Exp $ */
/* $NetBSD: n_tan.S,v 1.1 1995/10/10 23:40:31 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -46,6 +46,12 @@
* S. McDonald, April 4, 1985
*/
+ENTRY(tanf, 0)
+ cvtfd 4(%ap),-(%sp)
+ calls $2,_C_LABEL(tan)
+ cvtdf %r0,%r0
+ ret
+
STRONG_ALIAS(tanl,tan)
ENTRY(tan, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
movq 4(%ap),%r0