summaryrefslogtreecommitdiffstats
path: root/lib/libm/arch/vax
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2008-12-09 20:00:35 +0000
committermartynas <martynas@openbsd.org>2008-12-09 20:00:35 +0000
commit390c8400525fc0ecc9e2c49c2246076b1b49fe19 (patch)
tree53eacecd5d140dfe4af32e85cbd374f340c935fc /lib/libm/arch/vax
parent- add long double signbit (diff)
downloadwireguard-openbsd-390c8400525fc0ecc9e2c49c2246076b1b49fe19.tar.xz
wireguard-openbsd-390c8400525fc0ecc9e2c49c2246076b1b49fe19.zip
- 80-bit and quad precision trigonometric and other most
important functions: acosl, asinl, atanl, atan2l, cosl, sinl, tanl, exp2l, frexpl, ilogbl, ldexpl, logbl, scalbnl, fabsl, hypotl, powl, sqrtl, rintl, copysignl, nanl, fdiml, fmaxl, fminl. mostly taken from freebsd, needed alot of changes to adapt. note, these are all c versions; and are quite slow when architectures have, e.g. sqrt. assembly versions will be added afterwards - make them .weak/__weak_alias to the double precision versions on other archs - no need to have two finites. finite() and finitef() are non-standard 3BSD obsolete versions of isfinite. remove from libm. make them weak_alias in libc to __isfinite and __isfinitef instead. similarly make 3BSD obsolete versions of isinf, isinff, isnan, isnanf weak_aliases to C99's __isinf, __isinff, __isnan, __isnanf - remove unused infinity.c. the c library has infinities for each supported platform - use STRICT_ASSIGN cast hack for _kernel_rem_pio2, so that the double version has a chance of working on i386 with extra precision - avoid storing multiple copies of the pi/2 array, since it won't vary - bump major due to removed finite/finitef. although they will be in libc, which anything is linked to, minor bump might be enough ok millert@. tested by sthen@, jsg@, ajacoutot@, kili@, naddy@
Diffstat (limited to 'lib/libm/arch/vax')
-rw-r--r--lib/libm/arch/vax/n_atan2.S5
-rw-r--r--lib/libm/arch/vax/n_sincos.S8
-rw-r--r--lib/libm/arch/vax/n_sqrt.S6
-rw-r--r--lib/libm/arch/vax/n_support.S26
-rw-r--r--lib/libm/arch/vax/n_tan.S5
5 files changed, 30 insertions, 20 deletions
diff --git a/lib/libm/arch/vax/n_atan2.S b/lib/libm/arch/vax/n_atan2.S
index 7892e352a3b..2cf39beeb90 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.3 2008/05/21 20:37:10 miod Exp $ */
+/* $OpenBSD: n_atan2.S,v 1.4 2008/12/09 20:00:35 martynas Exp $ */
/* $NetBSD: n_atan2.S,v 1.1 1995/10/10 23:40:25 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -73,6 +73,9 @@
* atan2(y,x) returns the exact ARG(x+iy) nearly rounded.
*/
+.weak atan2l
+ atan2l = atan2
+
ENTRY(atan2, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
movq 4(ap),r2 # r2 = y
movq 12(ap),r4 # r4 = x
diff --git a/lib/libm/arch/vax/n_sincos.S b/lib/libm/arch/vax/n_sincos.S
index a9f0bcc35b8..e0487088765 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.4 2008/06/21 08:26:19 martynas Exp $ */
+/* $OpenBSD: n_sincos.S,v 1.5 2008/12/09 20:00:35 martynas Exp $ */
/* $NetBSD: n_sincos.S,v 1.1 1995/10/10 23:40:28 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -48,6 +48,9 @@
* S. McDonald, April 4, 1985
*/
+.weak sinl
+ sinl = sin
+
ENTRY(sin, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
movq 4(ap),r0
bicw3 $0x807f,r0,r2
@@ -77,6 +80,9 @@ ENTRY(sin, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
* S. McDonald, April 4, 1985
*/
+.weak cosl
+ cosl = cos
+
ENTRY(cos, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
movq 4(ap),r0
bicw3 $0x7f,r0,r2
diff --git a/lib/libm/arch/vax/n_sqrt.S b/lib/libm/arch/vax/n_sqrt.S
index 5050c9fefc5..a1fd2ba61fb 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.5 2008/09/16 22:13:12 martynas Exp $ */
+/* $OpenBSD: n_sqrt.S,v 1.6 2008/12/09 20:00:35 martynas Exp $ */
/* $NetBSD: n_sqrt.S,v 1.1 1995/10/10 23:40:29 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -44,6 +44,10 @@
*
* entry points: sqrt double arg is on the stack
*/
+
+.weak sqrtl
+ sqrtl = sqrt
+
ENTRY(sqrt, R2|R3|R4|R5)
movq 4(ap),r0
dsqrt2: bicw3 $0x807f,r0,r2 # check exponent of input
diff --git a/lib/libm/arch/vax/n_support.S b/lib/libm/arch/vax/n_support.S
index 2f06891b861..f2572586526 100644
--- a/lib/libm/arch/vax/n_support.S
+++ b/lib/libm/arch/vax/n_support.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: n_support.S,v 1.13 2008/11/20 23:21:37 martynas Exp $ */
+/* $OpenBSD: n_support.S,v 1.14 2008/12/09 20:00:35 martynas Exp $ */
/* $NetBSD: n_support.S,v 1.1 1995/10/10 23:40:30 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -40,7 +40,6 @@
* logb(x),
* logbf(x),
* scalbn(x,N),
- * finite(x),
* remainder(x,y),
* Coded in vax assembly language by K.C. Ng, 3/14/85.
* Revised by K.C. Ng on 4/9/85.
@@ -52,6 +51,9 @@
* copysign(double x, double y)
*/
+.weak copysignl
+ copysignl = copysign
+
ENTRY(copysign, R2)
movq 4(ap),r0 # load x into r0
bicw3 $0x807f,r0,r2 # mask off the exponent of x
@@ -80,6 +82,9 @@ Fz: ret
* logb(double x)
*/
+.weak logbl
+ logbl = logb
+
ENTRY(logb, 0)
bicl3 $0xffff807f,4(ap),r0 # mask off the exponent of x
beql Ln
@@ -110,24 +115,13 @@ Fn: movl 4(ap),r0 # r0:1 = x (zero or reserved op)
1: ret
/*
- * long
- * finite(double x)
- */
-
-ENTRY(finite, 0)
- bicw3 $0x7f,4(ap),r0 # mask off the mantissa
- cmpw r0,$0x8000 # to see if x is the reserved op
- beql 1f # if so, return FALSE (0)
- movl $1,r0 # else return TRUE (1)
- ret
-1: clrl r0
- ret
-
-/*
* double
* scalbn(double x, int N)
*/
+.weak scalbnl
+ scalbnl = scalbn
+
ENTRY(scalbn, R2|R3)
movq 4(ap),r0
bicl3 $0xffff807f,r0,r3
diff --git a/lib/libm/arch/vax/n_tan.S b/lib/libm/arch/vax/n_tan.S
index 0f499a943fc..13ad1554429 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.4 2008/06/21 08:26:19 martynas Exp $ */
+/* $OpenBSD: n_tan.S,v 1.5 2008/12/09 20:00:35 martynas Exp $ */
/* $NetBSD: n_tan.S,v 1.1 1995/10/10 23:40:31 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -46,6 +46,9 @@
* S. McDonald, April 4, 1985
*/
+.weak tanl
+ tanl = tan
+
ENTRY(tan, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
movq 4(ap),r0
bicw3 $0x807f,r0,r2