Sat Jun 27 03:07:57 2020 UTC ()
Sort headers. No functional changes intended.


(rin)
diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_add.c
diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_compare.c
diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_div.c
diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_mul.c
diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_subr.c
diff -r1.19 -r1.20 src/sys/arch/powerpc/fpu/fpu_emu.c
diff -r1.7 -r1.8 src/sys/arch/powerpc/fpu/fpu_explode.c
diff -r1.6 -r1.7 src/sys/arch/powerpc/fpu/fpu_implode.c
diff -r1.5 -r1.6 src/sys/arch/powerpc/fpu/fpu_sqrt.c

cvs diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_add.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/fpu/fpu_add.c 2005/12/11 12:18:42 1.4
+++ src/sys/arch/powerpc/fpu/fpu_add.c 2020/06/27 03:07:57 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fpu_add.c,v 1.4 2005/12/11 12:18:42 christos Exp $ */ 1/* $NetBSD: fpu_add.c,v 1.5 2020/06/27 03:07:57 rin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This software was developed by the Computer Systems Engineering group 7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9 * contributed to Berkeley. 9 * contributed to Berkeley.
10 * 10 *
11 * All advertising materials mentioning features or use of this software 11 * All advertising materials mentioning features or use of this software
12 * must display the following acknowledgement: 12 * must display the following acknowledgement:
13 * This product includes software developed by the University of 13 * This product includes software developed by the University of
14 * California, Lawrence Berkeley Laboratory. 14 * California, Lawrence Berkeley Laboratory.
@@ -37,36 +37,36 @@ @@ -37,36 +37,36 @@
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE. 38 * SUCH DAMAGE.
39 * 39 *
40 * @(#)fpu_add.c 8.1 (Berkeley) 6/11/93 40 * @(#)fpu_add.c 8.1 (Berkeley) 6/11/93
41 */ 41 */
42 42
43/* 43/*
44 * Perform an FPU add (return x + y). 44 * Perform an FPU add (return x + y).
45 * 45 *
46 * To subtract, negate y and call add. 46 * To subtract, negate y and call add.
47 */ 47 */
48 48
49#include <sys/cdefs.h> 49#include <sys/cdefs.h>
50__KERNEL_RCSID(0, "$NetBSD: fpu_add.c,v 1.4 2005/12/11 12:18:42 christos Exp $"); 50__KERNEL_RCSID(0, "$NetBSD: fpu_add.c,v 1.5 2020/06/27 03:07:57 rin Exp $");
51 51
52#include <sys/types.h> 52#include <sys/types.h>
53#if defined(DIAGNOSTIC)||defined(DEBUG) 53#if defined(DIAGNOSTIC)||defined(DEBUG)
54#include <sys/systm.h> 54#include <sys/systm.h>
55#endif 55#endif
56 56
57#include <machine/reg.h> 
58#include <powerpc/instr.h> 57#include <powerpc/instr.h>
59#include <machine/fpu.h> 58#include <machine/fpu.h>
 59#include <machine/reg.h>
60 60
61#include <powerpc/fpu/fpu_arith.h> 61#include <powerpc/fpu/fpu_arith.h>
62#include <powerpc/fpu/fpu_emu.h> 62#include <powerpc/fpu/fpu_emu.h>
63#include <powerpc/fpu/fpu_extern.h> 63#include <powerpc/fpu/fpu_extern.h>
64 64
65struct fpn * 65struct fpn *
66fpu_add(struct fpemu *fe) 66fpu_add(struct fpemu *fe)
67{ 67{
68 struct fpn *x = &fe->fe_f1, *y = &fe->fe_f2, *r; 68 struct fpn *x = &fe->fe_f1, *y = &fe->fe_f2, *r;
69 u_int r0, r1, r2, r3; 69 u_int r0, r1, r2, r3;
70 int rd; 70 int rd;
71 71
72 /* 72 /*

cvs diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_compare.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/fpu/fpu_compare.c 2005/12/11 12:18:42 1.4
+++ src/sys/arch/powerpc/fpu/fpu_compare.c 2020/06/27 03:07:57 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fpu_compare.c,v 1.4 2005/12/11 12:18:42 christos Exp $ */ 1/* $NetBSD: fpu_compare.c,v 1.5 2020/06/27 03:07:57 rin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This software was developed by the Computer Systems Engineering group 7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9 * contributed to Berkeley. 9 * contributed to Berkeley.
10 * 10 *
11 * All advertising materials mentioning features or use of this software 11 * All advertising materials mentioning features or use of this software
12 * must display the following acknowledgement: 12 * must display the following acknowledgement:
13 * This product includes software developed by the University of 13 * This product includes software developed by the University of
14 * California, Lawrence Berkeley Laboratory. 14 * California, Lawrence Berkeley Laboratory.
@@ -38,32 +38,32 @@ @@ -38,32 +38,32 @@
38 * SUCH DAMAGE. 38 * SUCH DAMAGE.
39 * 39 *
40 * @(#)fpu_compare.c 8.1 (Berkeley) 6/11/93 40 * @(#)fpu_compare.c 8.1 (Berkeley) 6/11/93
41 */ 41 */
42 42
43/* 43/*
44 * FCMPU and FCMPO instructions. 44 * FCMPU and FCMPO instructions.
45 * 45 *
46 * These rely on the fact that our internal wide format is achieved by 46 * These rely on the fact that our internal wide format is achieved by
47 * adding zero bits to the end of narrower mantissas. 47 * adding zero bits to the end of narrower mantissas.
48 */ 48 */
49 49
50#include <sys/cdefs.h> 50#include <sys/cdefs.h>
51__KERNEL_RCSID(0, "$NetBSD: fpu_compare.c,v 1.4 2005/12/11 12:18:42 christos Exp $"); 51__KERNEL_RCSID(0, "$NetBSD: fpu_compare.c,v 1.5 2020/06/27 03:07:57 rin Exp $");
52 52
53#include <sys/types.h> 53#include <sys/types.h>
54 54
55#include <machine/reg.h> 
56#include <machine/fpu.h> 55#include <machine/fpu.h>
 56#include <machine/reg.h>
57 57
58#include <powerpc/fpu/fpu_arith.h> 58#include <powerpc/fpu/fpu_arith.h>
59#include <powerpc/fpu/fpu_emu.h> 59#include <powerpc/fpu/fpu_emu.h>
60 60
61/* 61/*
62 * Perform a compare instruction (with or without unordered exception). 62 * Perform a compare instruction (with or without unordered exception).
63 * This updates the fcc field in the fsr. 63 * This updates the fcc field in the fsr.
64 * 64 *
65 * If either operand is NaN, the result is unordered. For ordered, this 65 * If either operand is NaN, the result is unordered. For ordered, this
66 * causes an NV exception. Everything else is ordered: 66 * causes an NV exception. Everything else is ordered:
67 * |Inf| > |numbers| > |0|. 67 * |Inf| > |numbers| > |0|.
68 * We already arranged for fp_class(Inf) > fp_class(numbers) > fp_class(0), 68 * We already arranged for fp_class(Inf) > fp_class(numbers) > fp_class(0),
69 * so we get this directly. Note, however, that two zeros compare equal 69 * so we get this directly. Note, however, that two zeros compare equal

cvs diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_div.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/fpu/fpu_div.c 2005/12/11 12:18:42 1.4
+++ src/sys/arch/powerpc/fpu/fpu_div.c 2020/06/27 03:07:57 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fpu_div.c,v 1.4 2005/12/11 12:18:42 christos Exp $ */ 1/* $NetBSD: fpu_div.c,v 1.5 2020/06/27 03:07:57 rin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This software was developed by the Computer Systems Engineering group 7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9 * contributed to Berkeley. 9 * contributed to Berkeley.
10 * 10 *
11 * All advertising materials mentioning features or use of this software 11 * All advertising materials mentioning features or use of this software
12 * must display the following acknowledgement: 12 * must display the following acknowledgement:
13 * This product includes software developed by the University of 13 * This product includes software developed by the University of
14 * California, Lawrence Berkeley Laboratory. 14 * California, Lawrence Berkeley Laboratory.
@@ -35,35 +35,35 @@ @@ -35,35 +35,35 @@
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE. 38 * SUCH DAMAGE.
39 * 39 *
40 * @(#)fpu_div.c 8.1 (Berkeley) 6/11/93 40 * @(#)fpu_div.c 8.1 (Berkeley) 6/11/93
41 */ 41 */
42 42
43/* 43/*
44 * Perform an FPU divide (return x / y). 44 * Perform an FPU divide (return x / y).
45 */ 45 */
46 46
47#include <sys/cdefs.h> 47#include <sys/cdefs.h>
48__KERNEL_RCSID(0, "$NetBSD: fpu_div.c,v 1.4 2005/12/11 12:18:42 christos Exp $"); 48__KERNEL_RCSID(0, "$NetBSD: fpu_div.c,v 1.5 2020/06/27 03:07:57 rin Exp $");
49 49
50#include <sys/types.h> 50#include <sys/types.h>
51#if defined(DIAGNOSTIC)||defined(DEBUG) 51#if defined(DIAGNOSTIC)||defined(DEBUG)
52#include <sys/systm.h> 52#include <sys/systm.h>
53#endif 53#endif
54 54
55#include <machine/reg.h> 
56#include <machine/fpu.h> 55#include <machine/fpu.h>
 56#include <machine/reg.h>
57 57
58#include <powerpc/fpu/fpu_arith.h> 58#include <powerpc/fpu/fpu_arith.h>
59#include <powerpc/fpu/fpu_emu.h> 59#include <powerpc/fpu/fpu_emu.h>
60 60
61/* 61/*
62 * Division of normal numbers is done as follows: 62 * Division of normal numbers is done as follows:
63 * 63 *
64 * x and y are floating point numbers, i.e., in the form 1.bbbb * 2^e. 64 * x and y are floating point numbers, i.e., in the form 1.bbbb * 2^e.
65 * If X and Y are the mantissas (1.bbbb's), the quotient is then: 65 * If X and Y are the mantissas (1.bbbb's), the quotient is then:
66 * 66 *
67 * q = (X / Y) * 2^((x exponent) - (y exponent)) 67 * q = (X / Y) * 2^((x exponent) - (y exponent))
68 * 68 *
69 * Since X and Y are both in [1.0,2.0), the quotient's mantissa (X / Y) 69 * Since X and Y are both in [1.0,2.0), the quotient's mantissa (X / Y)

cvs diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_mul.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/fpu/fpu_mul.c 2005/12/11 12:18:42 1.4
+++ src/sys/arch/powerpc/fpu/fpu_mul.c 2020/06/27 03:07:57 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fpu_mul.c,v 1.4 2005/12/11 12:18:42 christos Exp $ */ 1/* $NetBSD: fpu_mul.c,v 1.5 2020/06/27 03:07:57 rin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This software was developed by the Computer Systems Engineering group 7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9 * contributed to Berkeley. 9 * contributed to Berkeley.
10 * 10 *
11 * All advertising materials mentioning features or use of this software 11 * All advertising materials mentioning features or use of this software
12 * must display the following acknowledgement: 12 * must display the following acknowledgement:
13 * This product includes software developed by the University of 13 * This product includes software developed by the University of
14 * California, Lawrence Berkeley Laboratory. 14 * California, Lawrence Berkeley Laboratory.
@@ -35,35 +35,35 @@ @@ -35,35 +35,35 @@
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE. 38 * SUCH DAMAGE.
39 * 39 *
40 * @(#)fpu_mul.c 8.1 (Berkeley) 6/11/93 40 * @(#)fpu_mul.c 8.1 (Berkeley) 6/11/93
41 */ 41 */
42 42
43/* 43/*
44 * Perform an FPU multiply (return x * y). 44 * Perform an FPU multiply (return x * y).
45 */ 45 */
46 46
47#include <sys/cdefs.h> 47#include <sys/cdefs.h>
48__KERNEL_RCSID(0, "$NetBSD: fpu_mul.c,v 1.4 2005/12/11 12:18:42 christos Exp $"); 48__KERNEL_RCSID(0, "$NetBSD: fpu_mul.c,v 1.5 2020/06/27 03:07:57 rin Exp $");
49 49
50#include <sys/types.h> 50#include <sys/types.h>
51#if defined(DIAGNOSTIC)||defined(DEBUG) 51#if defined(DIAGNOSTIC)||defined(DEBUG)
52#include <sys/systm.h> 52#include <sys/systm.h>
53#endif 53#endif
54 54
55#include <machine/reg.h> 
56#include <machine/fpu.h> 55#include <machine/fpu.h>
 56#include <machine/reg.h>
57 57
58#include <powerpc/fpu/fpu_arith.h> 58#include <powerpc/fpu/fpu_arith.h>
59#include <powerpc/fpu/fpu_emu.h> 59#include <powerpc/fpu/fpu_emu.h>
60 60
61/* 61/*
62 * The multiplication algorithm for normal numbers is as follows: 62 * The multiplication algorithm for normal numbers is as follows:
63 * 63 *
64 * The fraction of the product is built in the usual stepwise fashion. 64 * The fraction of the product is built in the usual stepwise fashion.
65 * Each step consists of shifting the accumulator right one bit 65 * Each step consists of shifting the accumulator right one bit
66 * (maintaining any guard bits) and, if the next bit in y is set, 66 * (maintaining any guard bits) and, if the next bit in y is set,
67 * adding the multiplicand (x) to the accumulator. Then, in any case, 67 * adding the multiplicand (x) to the accumulator. Then, in any case,
68 * we advance one bit leftward in y. Algorithmically: 68 * we advance one bit leftward in y. Algorithmically:
69 * 69 *

cvs diff -r1.4 -r1.5 src/sys/arch/powerpc/fpu/fpu_subr.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/fpu/fpu_subr.c 2005/12/11 12:18:42 1.4
+++ src/sys/arch/powerpc/fpu/fpu_subr.c 2020/06/27 03:07:57 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fpu_subr.c,v 1.4 2005/12/11 12:18:42 christos Exp $ */ 1/* $NetBSD: fpu_subr.c,v 1.5 2020/06/27 03:07:57 rin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This software was developed by the Computer Systems Engineering group 7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9 * contributed to Berkeley. 9 * contributed to Berkeley.
10 * 10 *
11 * All advertising materials mentioning features or use of this software 11 * All advertising materials mentioning features or use of this software
12 * must display the following acknowledgement: 12 * must display the following acknowledgement:
13 * This product includes software developed by the University of 13 * This product includes software developed by the University of
14 * California, Lawrence Berkeley Laboratory. 14 * California, Lawrence Berkeley Laboratory.
@@ -35,36 +35,36 @@ @@ -35,36 +35,36 @@
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE. 38 * SUCH DAMAGE.
39 * 39 *
40 * @(#)fpu_subr.c 8.1 (Berkeley) 6/11/93 40 * @(#)fpu_subr.c 8.1 (Berkeley) 6/11/93
41 */ 41 */
42 42
43/* 43/*
44 * FPU subroutines. 44 * FPU subroutines.
45 */ 45 */
46 46
47#include <sys/cdefs.h> 47#include <sys/cdefs.h>
48__KERNEL_RCSID(0, "$NetBSD: fpu_subr.c,v 1.4 2005/12/11 12:18:42 christos Exp $"); 48__KERNEL_RCSID(0, "$NetBSD: fpu_subr.c,v 1.5 2020/06/27 03:07:57 rin Exp $");
49 49
50#include <sys/types.h> 50#include <sys/types.h>
51#if defined(DIAGNOSTIC)||defined(DEBUG) 51#if defined(DIAGNOSTIC)||defined(DEBUG)
52#include <sys/systm.h> 52#include <sys/systm.h>
53#endif 53#endif
54 54
55#include <machine/reg.h> 
56#include <powerpc/instr.h> 55#include <powerpc/instr.h>
57#include <machine/fpu.h> 56#include <machine/fpu.h>
 57#include <machine/reg.h>
58 58
59#include <powerpc/fpu/fpu_arith.h> 59#include <powerpc/fpu/fpu_arith.h>
60#include <powerpc/fpu/fpu_emu.h> 60#include <powerpc/fpu/fpu_emu.h>
61#include <powerpc/fpu/fpu_extern.h> 61#include <powerpc/fpu/fpu_extern.h>
62 62
63/* 63/*
64 * Shift the given number right rsh bits. Any bits that `fall off' will get 64 * Shift the given number right rsh bits. Any bits that `fall off' will get
65 * shoved into the sticky field; we return the resulting sticky. Note that 65 * shoved into the sticky field; we return the resulting sticky. Note that
66 * shifting NaNs is legal (this will never shift all bits out); a NaN's 66 * shifting NaNs is legal (this will never shift all bits out); a NaN's
67 * sticky field is ignored anyway. 67 * sticky field is ignored anyway.
68 */ 68 */
69int 69int
70fpu_shr(struct fpn *fp, int rsh) 70fpu_shr(struct fpn *fp, int rsh)

cvs diff -r1.19 -r1.20 src/sys/arch/powerpc/fpu/fpu_emu.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/fpu/fpu_emu.c 2016/12/28 10:52:30 1.19
+++ src/sys/arch/powerpc/fpu/fpu_emu.c 2020/06/27 03:07:57 1.20
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fpu_emu.c,v 1.19 2016/12/28 10:52:30 rin Exp $ */ 1/* $NetBSD: fpu_emu.c,v 1.20 2020/06/27 03:07:57 rin Exp $ */
2 2
3/* 3/*
4 * Copyright 2001 Wasabi Systems, Inc. 4 * Copyright 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. 7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -66,42 +66,42 @@ @@ -66,42 +66,42 @@
66 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 66 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
67 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 67 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
68 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 68 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
69 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 69 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
70 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 70 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
71 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 71 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
72 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 72 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
73 * SUCH DAMAGE. 73 * SUCH DAMAGE.
74 * 74 *
75 * @(#)fpu.c 8.1 (Berkeley) 6/11/93 75 * @(#)fpu.c 8.1 (Berkeley) 6/11/93
76 */ 76 */
77 77
78#include <sys/cdefs.h> 78#include <sys/cdefs.h>
79__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.19 2016/12/28 10:52:30 rin Exp $"); 79__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.20 2020/06/27 03:07:57 rin Exp $");
80 80
81#include "opt_ddb.h" 81#include "opt_ddb.h"
82 82
83#include <sys/param.h> 83#include <sys/param.h>
 84#include <sys/systm.h>
 85#include <sys/evcnt.h>
84#include <sys/proc.h> 86#include <sys/proc.h>
 87#include <sys/siginfo.h>
85#include <sys/signal.h> 88#include <sys/signal.h>
86#include <sys/signalvar.h> 89#include <sys/signalvar.h>
87#include <sys/siginfo.h> 
88#include <sys/systm.h> 
89#include <sys/syslog.h> 90#include <sys/syslog.h>
90#include <sys/evcnt.h> 
91 91
92#include <powerpc/instr.h> 92#include <powerpc/instr.h>
93#include <machine/reg.h> 
94#include <machine/fpu.h> 93#include <machine/fpu.h>
 94#include <machine/reg.h>
95#include <machine/trap.h> 95#include <machine/trap.h>
96 96
97#include <powerpc/fpu/fpu_emu.h> 97#include <powerpc/fpu/fpu_emu.h>
98#include <powerpc/fpu/fpu_extern.h> 98#include <powerpc/fpu/fpu_extern.h>
99 99
100#define FPU_EMU_EVCNT_DECL(name) \ 100#define FPU_EMU_EVCNT_DECL(name) \
101static struct evcnt fpu_emu_ev_##name = \ 101static struct evcnt fpu_emu_ev_##name = \
102 EVCNT_INITIALIZER(EVCNT_TYPE_TRAP, NULL, "fpemu", #name); \ 102 EVCNT_INITIALIZER(EVCNT_TYPE_TRAP, NULL, "fpemu", #name); \
103EVCNT_ATTACH_STATIC(fpu_emu_ev_##name) 103EVCNT_ATTACH_STATIC(fpu_emu_ev_##name)
104 104
105#define FPU_EMU_EVCNT_INCR(name) \ 105#define FPU_EMU_EVCNT_INCR(name) \
106 fpu_emu_ev_##name.ev_count++ 106 fpu_emu_ev_##name.ev_count++
107 107

cvs diff -r1.7 -r1.8 src/sys/arch/powerpc/fpu/fpu_explode.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/fpu/fpu_explode.c 2016/12/28 10:30:04 1.7
+++ src/sys/arch/powerpc/fpu/fpu_explode.c 2020/06/27 03:07:57 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fpu_explode.c,v 1.7 2016/12/28 10:30:04 rin Exp $ */ 1/* $NetBSD: fpu_explode.c,v 1.8 2020/06/27 03:07:57 rin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This software was developed by the Computer Systems Engineering group 7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9 * contributed to Berkeley. 9 * contributed to Berkeley.
10 * 10 *
11 * All advertising materials mentioning features or use of this software 11 * All advertising materials mentioning features or use of this software
12 * must display the following acknowledgement: 12 * must display the following acknowledgement:
13 * This product includes software developed by the University of 13 * This product includes software developed by the University of
14 * California, Lawrence Berkeley Laboratory. 14 * California, Lawrence Berkeley Laboratory.
@@ -36,35 +36,35 @@ @@ -36,35 +36,35 @@
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE. 38 * SUCH DAMAGE.
39 * 39 *
40 * @(#)fpu_explode.c 8.1 (Berkeley) 6/11/93 40 * @(#)fpu_explode.c 8.1 (Berkeley) 6/11/93
41 */ 41 */
42 42
43/* 43/*
44 * FPU subroutines: `explode' the machine's `packed binary' format numbers 44 * FPU subroutines: `explode' the machine's `packed binary' format numbers
45 * into our internal format. 45 * into our internal format.
46 */ 46 */
47 47
48#include <sys/cdefs.h> 48#include <sys/cdefs.h>
49__KERNEL_RCSID(0, "$NetBSD: fpu_explode.c,v 1.7 2016/12/28 10:30:04 rin Exp $"); 49__KERNEL_RCSID(0, "$NetBSD: fpu_explode.c,v 1.8 2020/06/27 03:07:57 rin Exp $");
50 50
51#include <sys/types.h> 51#include <sys/types.h>
52#include <sys/systm.h> 52#include <sys/systm.h>
53 53
54#include <machine/ieee.h> 
55#include <powerpc/instr.h> 54#include <powerpc/instr.h>
56#include <machine/reg.h> 
57#include <machine/fpu.h> 55#include <machine/fpu.h>
 56#include <machine/ieee.h>
 57#include <machine/reg.h>
58 58
59#include <powerpc/fpu/fpu_arith.h> 59#include <powerpc/fpu/fpu_arith.h>
60#include <powerpc/fpu/fpu_emu.h> 60#include <powerpc/fpu/fpu_emu.h>
61#include <powerpc/fpu/fpu_extern.h> 61#include <powerpc/fpu/fpu_extern.h>
62 62
63/* 63/*
64 * N.B.: in all of the following, we assume the FP format is 64 * N.B.: in all of the following, we assume the FP format is
65 * 65 *
66 * --------------------------- 66 * ---------------------------
67 * | s | exponent | fraction | 67 * | s | exponent | fraction |
68 * --------------------------- 68 * ---------------------------
69 * 69 *
70 * (which represents -1**s * 1.fraction * 2**exponent), so that the 70 * (which represents -1**s * 1.fraction * 2**exponent), so that the

cvs diff -r1.6 -r1.7 src/sys/arch/powerpc/fpu/fpu_implode.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/fpu/fpu_implode.c 2005/12/11 12:18:42 1.6
+++ src/sys/arch/powerpc/fpu/fpu_implode.c 2020/06/27 03:07:57 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fpu_implode.c,v 1.6 2005/12/11 12:18:42 christos Exp $ */ 1/* $NetBSD: fpu_implode.c,v 1.7 2020/06/27 03:07:57 rin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This software was developed by the Computer Systems Engineering group 7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9 * contributed to Berkeley. 9 * contributed to Berkeley.
10 * 10 *
11 * All advertising materials mentioning features or use of this software 11 * All advertising materials mentioning features or use of this software
12 * must display the following acknowledgement: 12 * must display the following acknowledgement:
13 * This product includes software developed by the University of 13 * This product includes software developed by the University of
14 * California, Lawrence Berkeley Laboratory. 14 * California, Lawrence Berkeley Laboratory.
@@ -36,35 +36,35 @@ @@ -36,35 +36,35 @@
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE. 38 * SUCH DAMAGE.
39 * 39 *
40 * @(#)fpu_implode.c 8.1 (Berkeley) 6/11/93 40 * @(#)fpu_implode.c 8.1 (Berkeley) 6/11/93
41 */ 41 */
42 42
43/* 43/*
44 * FPU subroutines: `implode' internal format numbers into the machine's 44 * FPU subroutines: `implode' internal format numbers into the machine's
45 * `packed binary' format. 45 * `packed binary' format.
46 */ 46 */
47 47
48#include <sys/cdefs.h> 48#include <sys/cdefs.h>
49__KERNEL_RCSID(0, "$NetBSD: fpu_implode.c,v 1.6 2005/12/11 12:18:42 christos Exp $"); 49__KERNEL_RCSID(0, "$NetBSD: fpu_implode.c,v 1.7 2020/06/27 03:07:57 rin Exp $");
50 50
51#include <sys/types.h> 51#include <sys/types.h>
52#include <sys/systm.h> 52#include <sys/systm.h>
53 53
54#include <machine/ieee.h> 
55#include <powerpc/instr.h> 54#include <powerpc/instr.h>
56#include <machine/reg.h> 
57#include <machine/fpu.h> 55#include <machine/fpu.h>
 56#include <machine/ieee.h>
 57#include <machine/reg.h>
58 58
59#include <powerpc/fpu/fpu_arith.h> 59#include <powerpc/fpu/fpu_arith.h>
60#include <powerpc/fpu/fpu_emu.h> 60#include <powerpc/fpu/fpu_emu.h>
61#include <powerpc/fpu/fpu_extern.h> 61#include <powerpc/fpu/fpu_extern.h>
62 62
63static int round(struct fpemu *, struct fpn *); 63static int round(struct fpemu *, struct fpn *);
64static int toinf(struct fpemu *, int); 64static int toinf(struct fpemu *, int);
65 65
66/* 66/*
67 * Round a number (algorithm from Motorola MC68882 manual, modified for 67 * Round a number (algorithm from Motorola MC68882 manual, modified for
68 * our internal format). Set inexact exception if rounding is required. 68 * our internal format). Set inexact exception if rounding is required.
69 * Return true iff we rounded up. 69 * Return true iff we rounded up.
70 * 70 *

cvs diff -r1.5 -r1.6 src/sys/arch/powerpc/fpu/fpu_sqrt.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/fpu/fpu_sqrt.c 2014/02/25 14:16:25 1.5
+++ src/sys/arch/powerpc/fpu/fpu_sqrt.c 2020/06/27 03:07:57 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fpu_sqrt.c,v 1.5 2014/02/25 14:16:25 martin Exp $ */ 1/* $NetBSD: fpu_sqrt.c,v 1.6 2020/06/27 03:07:57 rin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This software was developed by the Computer Systems Engineering group 7 * This software was developed by the Computer Systems Engineering group
8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9 * contributed to Berkeley. 9 * contributed to Berkeley.
10 * 10 *
11 * All advertising materials mentioning features or use of this software 11 * All advertising materials mentioning features or use of this software
12 * must display the following acknowledgement: 12 * must display the following acknowledgement:
13 * This product includes software developed by the University of 13 * This product includes software developed by the University of
14 * California, Lawrence Berkeley Laboratory. 14 * California, Lawrence Berkeley Laboratory.
@@ -35,35 +35,35 @@ @@ -35,35 +35,35 @@
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE. 38 * SUCH DAMAGE.
39 * 39 *
40 * @(#)fpu_sqrt.c 8.1 (Berkeley) 6/11/93 40 * @(#)fpu_sqrt.c 8.1 (Berkeley) 6/11/93
41 */ 41 */
42 42
43/* 43/*
44 * Perform an FPU square root (return sqrt(x)). 44 * Perform an FPU square root (return sqrt(x)).
45 */ 45 */
46 46
47#include <sys/cdefs.h> 47#include <sys/cdefs.h>
48__KERNEL_RCSID(0, "$NetBSD: fpu_sqrt.c,v 1.5 2014/02/25 14:16:25 martin Exp $"); 48__KERNEL_RCSID(0, "$NetBSD: fpu_sqrt.c,v 1.6 2020/06/27 03:07:57 rin Exp $");
49 49
50#include <sys/types.h> 50#include <sys/types.h>
51#if defined(DIAGNOSTIC)||defined(DEBUG) 51#if defined(DIAGNOSTIC)||defined(DEBUG)
52#include <sys/systm.h> 52#include <sys/systm.h>
53#endif 53#endif
54 54
55#include <machine/reg.h> 
56#include <machine/fpu.h> 55#include <machine/fpu.h>
 56#include <machine/reg.h>
57 57
58#include <powerpc/fpu/fpu_arith.h> 58#include <powerpc/fpu/fpu_arith.h>
59#include <powerpc/fpu/fpu_emu.h> 59#include <powerpc/fpu/fpu_emu.h>
60 60
61/* 61/*
62 * Our task is to calculate the square root of a floating point number x0. 62 * Our task is to calculate the square root of a floating point number x0.
63 * This number x normally has the form: 63 * This number x normally has the form:
64 * 64 *
65 * exp 65 * exp
66 * x = mant * 2 (where 1 <= mant < 2 and exp is an integer) 66 * x = mant * 2 (where 1 <= mant < 2 and exp is an integer)
67 * 67 *
68 * This can be left as it stands, or the mantissa can be doubled and the 68 * This can be left as it stands, or the mantissa can be doubled and the
69 * exponent decremented: 69 * exponent decremented: