Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/lib/libm Apply patch (requested by user, approved by th...
details: https://anonhg.NetBSD.org/src/rev/bb16da1868c2
branches: netbsd-1-5
changeset: 489113:bb16da1868c2
user: ragge <ragge%NetBSD.org@localhost>
date: Mon Aug 14 21:24:15 2000 +0000
description:
Apply patch (requested by user, approved by thorpej):
Dynamic linked JSB called global labels don't work, subroutines
must be called with CALLS instead. This patch fixes it for the 1.5 release.
diffstat:
lib/libm/Makefile | 20 ++++++--------------
lib/libm/arch/vax/n_argred.S | 24 ++++++++++--------------
lib/libm/arch/vax/n_sincos.S | 25 +++++++++----------------
lib/libm/arch/vax/n_tan.S | 14 ++++++--------
4 files changed, 31 insertions(+), 52 deletions(-)
diffs (229 lines):
diff -r 432e5eabc46f -r bb16da1868c2 lib/libm/Makefile
--- a/lib/libm/Makefile Mon Aug 14 21:23:52 2000 +0000
+++ b/lib/libm/Makefile Mon Aug 14 21:24:15 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.52 1999/12/13 09:40:27 christos Exp $
+# $NetBSD: Makefile,v 1.52.4.1 2000/08/14 21:24:15 ragge Exp $
#
# @(#)Makefile 5.1beta 93/09/24
#
@@ -82,11 +82,9 @@
.endif
# end of m68k
.elif (${MACHINE_ARCH} == "vax")
-#.PATH: ${.CURDIR}/arch/vax
-#NOIEEE_ARCH= n_infnan.S n_argred.S n_sqrt.S
-#ARCH_SRCS = n_atan2.S n_cabs.S n_cbrt.S n_support.S n_sincos.S n_tan.S
-# XXX - ripped out due to lack of the insn polyd in the Mariah chip,
-# and emulation code isn't written yet.
+.PATH: ${.CURDIR}/arch/vax
+NOIEEE_ARCH= n_infnan.S n_argred.S n_sqrt.S
+ARCH_SRCS = n_atan2.S n_cabs.S n_cbrt.S n_support.S n_sincos.S n_tan.S
.endif
.PATH: ${.CURDIR}/man
@@ -131,8 +129,8 @@
n_erf.c n_exp.c n_exp__E.c n_expm1.c n_floor.c n_fmod.c n_gamma.c \
n_lgamma.c n_j0.c n_j1.c n_jn.c n_log.c n_log10.c n_log1p.c \
n_log__L.c n_pow.c n_sinh.c n_tanh.c \
- n_sincos.c n_tan.c
-# n_sqrt.c n_argred.c n_infnan.c n_atan2.c n_cabs.c n_cbrt.c n_support.c
+ n_sincos.c n_tan.c \
+ n_sqrt.c n_argred.c n_infnan.c n_atan2.c n_cabs.c n_cbrt.c n_support.c
# NetBSD's C library supplies these functions:
@@ -153,12 +151,6 @@
SRCS:=${SRCS:S/${i:S/.S/.c/}/$i/}
.endfor
-.if (${MACHINE_ARCH} == "vax") # XXX until POLYD is written.
-.PATH: ${.CURDIR}/arch/vax
-SRCS:=${SRCS} n_sqrt.S n_argred.S n_infnan.S n_atan2.S n_cabs.S n_cbrt.S \
- n_support.S
-.endif
-
# XXX lint buts on some archs and needs stubs
MKLINT=no
diff -r 432e5eabc46f -r bb16da1868c2 lib/libm/arch/vax/n_argred.S
--- a/lib/libm/arch/vax/n_argred.S Mon Aug 14 21:23:52 2000 +0000
+++ b/lib/libm/arch/vax/n_argred.S Mon Aug 14 21:24:15 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_argred.S,v 1.4 1999/07/02 15:37:35 simonb Exp $ */
+/* $NetBSD: n_argred.S,v 1.4.8.1 2000/08/14 21:24:15 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,23 +35,19 @@
*/
/*
- * libm$argred implements Bob Corbett's argument reduction and
- * libm$sincos implements Peter Tang's double precision sin/cos.
+ * libm_argred implements Bob Corbett's argument reduction and
+ * libm_sincos implements Peter Tang's double precision sin/cos.
*
- * Note: The two entry points libm$argred and libm$sincos are meant
+ * Note: The two entry points libm_argred and libm_sincos are meant
* to be used only by _sin, _cos and _tan.
*
* method: true range reduction to [-pi/4,pi/4], P. Tang & B. Corbett
* S. McDonald, April 4, 1985
*/
+#include <machine/asm.h>
.text
- .globl libm$argred
- .type libm$argred,@label
- .globl libm$sincos
- .type libm$sincos,@label
- .align 1
-libm$argred:
+ENTRY(_libm_argred, 0)
/*
* Compare the argument with the largest possible that can
* be reduced by table lookup. r3 := |x| will be used in table_lookup .
@@ -63,10 +59,10 @@
cmpd r3,$0d+4.55530934770520019583e+01
blss small_arg
jsb trigred
- rsb
+ ret
small_arg:
jsb table_lookup
- rsb
+ ret
/*
* At this point,
* r0 contains the quadrant number, 0, 1, 2, or 3;
@@ -74,7 +70,7 @@
* r3 contains a F-format extension to the reduced argument;
* r4 contains a 0 or 1 corresponding to a sin or cos entry.
*/
-libm$sincos:
+ENTRY(_libm_sincos, 0)
/*
* Compensate for a cosine entry by adding one to the quadrant number.
*/
@@ -124,7 +120,7 @@
blbc r9,even
mnegd r0,r0
even:
- rsb
+ ret
.data
.align 2
diff -r 432e5eabc46f -r bb16da1868c2 lib/libm/arch/vax/n_sincos.S
--- a/lib/libm/arch/vax/n_sincos.S Mon Aug 14 21:23:52 2000 +0000
+++ b/lib/libm/arch/vax/n_sincos.S Mon Aug 14 21:24:15 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_sincos.S,v 1.3 1999/07/02 15:37:35 simonb Exp $ */
+/* $NetBSD: n_sincos.S,v 1.3.8.1 2000/08/14 21:24:15 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -50,11 +50,8 @@
*/
#include <machine/asm.h>
.text
- .align 1
- .globl _sin
- .type _sin@function
-_sin:
- .word 0xffc # save r2-r11
+
+ENTRY(sin, R6|R7|R8|R9|R10|R11)
movq 4(ap),r0
bicw3 $0x807f,r0,r2
beql 1f # if x is zero or reserved operand then return x
@@ -70,9 +67,9 @@
/*
* Entered by sine ; save 0 in r4 .
*/
- jsb libm$argred
+ calls $0,__libm_argred
movl $0,r4
- jsb libm$sincos
+ calls $0,__libm_sincos
bispsw (sp)+
1: ret
@@ -82,12 +79,8 @@
* method: true range reduction to [-pi/4,pi/4], P. Tang & B. Corbett
* S. McDonald, April 4, 1985
*/
- .text
- .align 1
- .globl _cos
- .type _cos,@function
-_cos:
- .word 0xffc # save r2-r11
+
+ENTRY(cos, R6|R7|R8|R9|R10|R11)
movq 4(ap),r0
bicw3 $0x7f,r0,r2
cmpw $0x8000,r2
@@ -104,8 +97,8 @@
/*
* Entered by cosine ; save 1 in r4 .
*/
- jsb libm$argred
+ calls $0,__libm_argred
movl $1,r4
- jsb libm$sincos
+ calls $0,__libm_sincos
bispsw (sp)+
1: ret
diff -r 432e5eabc46f -r bb16da1868c2 lib/libm/arch/vax/n_tan.S
--- a/lib/libm/arch/vax/n_tan.S Mon Aug 14 21:23:52 2000 +0000
+++ b/lib/libm/arch/vax/n_tan.S Mon Aug 14 21:24:15 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_tan.S,v 1.3 1999/07/02 15:37:35 simonb Exp $ */
+/* $NetBSD: n_tan.S,v 1.3.8.1 2000/08/14 21:24:16 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -46,12 +46,10 @@
* method: true range reduction to [-pi/4,pi/4], P. Tang & B. Corbett
* S. McDonald, April 4, 1985
*/
+#include <machine/asm.h>
.text
- .align 1
- .globl _tan
- .type _tan,@function
-_tan: .word 0xffc # save r2-r11
+ENTRY(tan, R6|R7|R8|R9|R10|R11)
movq 4(ap),r0
bicw3 $0x807f,r0,r2
beql 1f # if x is zero or reserved operand then return x
@@ -64,7 +62,7 @@
* Clear the IV & FU bits.
*/
bicpsw $0x0060
- jsb libm$argred
+ calls $0,__libm_argred
/*
* At this point,
* r0 contains the quadrant number, 0, 1, 2, or 3;
@@ -79,7 +77,7 @@
* Call sine. r4 = 0 implies sine.
*/
movl $0,r4
- jsb libm$sincos
+ calls $0,__libm_sincos
/*
* Save sin(x) in r11/r10 .
*/
@@ -90,7 +88,7 @@
movq (sp)+,r0
movq (sp)+,r2
movl $1,r4
- jsb libm$sincos
+ calls $0,__libm_sincos
divd3 r0,r10,r0
bispsw (sp)+
1: ret
Home |
Main Index |
Thread Index |
Old Index