Thu Apr 23 03:12:49 2020 UTC ()
Remove "#ifndef __mc68010__ #error" I added when these {,u}divsi3.S and
{,u}modsi3.S were moved here (It was better to split the commit, sorry);
bootloader for sun3 still depends on them.


(rin)
diff -r1.3 -r1.4 src/sys/lib/libkern/arch/m68k/divsi3.S
diff -r1.3 -r1.4 src/sys/lib/libkern/arch/m68k/modsi3.S
diff -r1.3 -r1.4 src/sys/lib/libkern/arch/m68k/umodsi3.S
diff -r1.5 -r1.6 src/sys/lib/libkern/arch/m68k/udivsi3.S

cvs diff -r1.3 -r1.4 src/sys/lib/libkern/arch/m68k/divsi3.S (expand / switch to unified diff)

--- src/sys/lib/libkern/arch/m68k/divsi3.S 2020/04/22 11:58:26 1.3
+++ src/sys/lib/libkern/arch/m68k/divsi3.S 2020/04/23 03:12:49 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: divsi3.S,v 1.3 2020/04/22 11:58:26 rin Exp $ */ 1/* $NetBSD: divsi3.S,v 1.4 2020/04/23 03:12:49 rin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990 The Regents of the University of California. 4 * Copyright (c) 1990 The Regents of the University of California.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer 8 * the Systems Programming Group of the University of Utah Computer
9 * Science Department. 9 * Science Department.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -29,33 +29,33 @@ @@ -29,33 +29,33 @@
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 */ 34 */
35 35
36#include <machine/asm.h> 36#include <machine/asm.h>
37 37
38#if defined(LIBC_SCCS) && !defined(lint) 38#if defined(LIBC_SCCS) && !defined(lint)
39#if 0 39#if 0
40 RCSID("from: @(#)divsi3.s 5.1 (Berkeley) 6/7/90") 40 RCSID("from: @(#)divsi3.s 5.1 (Berkeley) 6/7/90")
41#else 41#else
42 RCSID("$NetBSD: divsi3.S,v 1.3 2020/04/22 11:58:26 rin Exp $") 42 RCSID("$NetBSD: divsi3.S,v 1.4 2020/04/23 03:12:49 rin Exp $")
43#endif 43#endif
44#endif /* LIBC_SCCS and not lint */ 44#endif /* LIBC_SCCS and not lint */
45 45
46/* int / int */ 46/* int / int */
47#ifndef __mc68010__ 47#ifndef __mc68010__
48#error 48/* XXX sun3 need this for bootloader */
49ENTRY(__divsi3) 49ENTRY(__divsi3)
50 movel 4(%sp),%d0 50 movel 4(%sp),%d0
51 divsl 8(%sp),%d0 51 divsl 8(%sp),%d0
52 rts 52 rts
53END(__divsi3) 53END(__divsi3)
54#else 54#else
55ENTRY(__divsi3) 55ENTRY(__divsi3)
56| NB: this requires that __udivsi3 preserve %a0: 56| NB: this requires that __udivsi3 preserve %a0:
57 movel 4(%sp), %d1 | load the dividend 57 movel 4(%sp), %d1 | load the dividend
58 bpl 1f 58 bpl 1f
59 negl 4(%sp) | store abs(dividend) 59 negl 4(%sp) | store abs(dividend)
601: movel 8(%sp), %d0 | load the divisor 601: movel 8(%sp), %d0 | load the divisor
61 bpl 2f 61 bpl 2f

cvs diff -r1.3 -r1.4 src/sys/lib/libkern/arch/m68k/modsi3.S (expand / switch to unified diff)

--- src/sys/lib/libkern/arch/m68k/modsi3.S 2020/04/22 11:58:26 1.3
+++ src/sys/lib/libkern/arch/m68k/modsi3.S 2020/04/23 03:12:49 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: modsi3.S,v 1.3 2020/04/22 11:58:26 rin Exp $ */ 1/* $NetBSD: modsi3.S,v 1.4 2020/04/23 03:12:49 rin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990 The Regents of the University of California. 4 * Copyright (c) 1990 The Regents of the University of California.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer 8 * the Systems Programming Group of the University of Utah Computer
9 * Science Department. 9 * Science Department.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -29,33 +29,33 @@ @@ -29,33 +29,33 @@
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 */ 34 */
35 35
36#include <machine/asm.h> 36#include <machine/asm.h>
37 37
38#if defined(LIBC_SCCS) && !defined(lint) 38#if defined(LIBC_SCCS) && !defined(lint)
39#if 0 39#if 0
40 RCSID("from: @(#)modsi3.s 5.1 (Berkeley) 6/7/90") 40 RCSID("from: @(#)modsi3.s 5.1 (Berkeley) 6/7/90")
41#else 41#else
42 RCSID("$NetBSD: modsi3.S,v 1.3 2020/04/22 11:58:26 rin Exp $") 42 RCSID("$NetBSD: modsi3.S,v 1.4 2020/04/23 03:12:49 rin Exp $")
43#endif 43#endif
44#endif /* LIBC_SCCS and not lint */ 44#endif /* LIBC_SCCS and not lint */
45 45
46/* int % int */ 46/* int % int */
47#ifndef __mc68010__ 47#ifndef __mc68010__
48#error 48/* XXX sun3 need this for bootloader */
49ENTRY(__modsi3) 49ENTRY(__modsi3)
50 movel 4(%sp),%d1 50 movel 4(%sp),%d1
51#ifdef __mcoldfire__ 51#ifdef __mcoldfire__
52 remsl 8(%sp),%d0:%d1 52 remsl 8(%sp),%d0:%d1
53 divsl 8(%sp),%d1 53 divsl 8(%sp),%d1
54#else 54#else
55 divsll 8(%sp),%d0:%d1 55 divsll 8(%sp),%d0:%d1
56#endif 56#endif
57 rts 57 rts
58END(__modsi3) 58END(__modsi3)
59#else 59#else
60ENTRY(__modsi3) 60ENTRY(__modsi3)
61| NB: this requires that __udivsi3 preserve %a0 and return 61| NB: this requires that __udivsi3 preserve %a0 and return

cvs diff -r1.3 -r1.4 src/sys/lib/libkern/arch/m68k/umodsi3.S (expand / switch to unified diff)

--- src/sys/lib/libkern/arch/m68k/umodsi3.S 2020/04/22 11:58:26 1.3
+++ src/sys/lib/libkern/arch/m68k/umodsi3.S 2020/04/23 03:12:49 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: umodsi3.S,v 1.3 2020/04/22 11:58:26 rin Exp $ */ 1/* $NetBSD: umodsi3.S,v 1.4 2020/04/23 03:12:49 rin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990 The Regents of the University of California. 4 * Copyright (c) 1990 The Regents of the University of California.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer 8 * the Systems Programming Group of the University of Utah Computer
9 * Science Department. 9 * Science Department.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -29,33 +29,33 @@ @@ -29,33 +29,33 @@
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 */ 34 */
35 35
36#include <machine/asm.h> 36#include <machine/asm.h>
37 37
38#if defined(LIBC_SCCS) && !defined(lint) 38#if defined(LIBC_SCCS) && !defined(lint)
39#if 0 39#if 0
40 RCSID("from: @(#)umodsi3.s 5.1 (Berkeley) 6/7/90")( 40 RCSID("from: @(#)umodsi3.s 5.1 (Berkeley) 6/7/90")(
41#else 41#else
42 RCSID("$NetBSD: umodsi3.S,v 1.3 2020/04/22 11:58:26 rin Exp $") 42 RCSID("$NetBSD: umodsi3.S,v 1.4 2020/04/23 03:12:49 rin Exp $")
43#endif 43#endif
44#endif /* LIBC_SCCS and not lint */ 44#endif /* LIBC_SCCS and not lint */
45 45
46/* unsigned % unsigned */ 46/* unsigned % unsigned */
47#ifndef __mc68010__ 47#ifndef __mc68010__
48#error 48/* XXX sun3 need this for bootloader */
49ENTRY(__umodsi3) 49ENTRY(__umodsi3)
50 movel 4(%sp),%d1 50 movel 4(%sp),%d1
51#ifdef __mcoldfire__ 51#ifdef __mcoldfire__
52 remul 8(%sp),%d0:%d1 52 remul 8(%sp),%d0:%d1
53 divul 8(%sp),%d1 53 divul 8(%sp),%d1
54#else 54#else
55 divull 8(%sp),%d0:%d1 55 divull 8(%sp),%d0:%d1
56#endif 56#endif
57 rts 57 rts
58END(__umodsi3) 58END(__umodsi3)
59#else 59#else
60ENTRY(__umodsi3) 60ENTRY(__umodsi3)
61| NB: this requires that __udivsi3 preserve the %a0 61| NB: this requires that __udivsi3 preserve the %a0

cvs diff -r1.5 -r1.6 src/sys/lib/libkern/arch/m68k/udivsi3.S (expand / switch to unified diff)

--- src/sys/lib/libkern/arch/m68k/udivsi3.S 2020/04/22 11:58:26 1.5
+++ src/sys/lib/libkern/arch/m68k/udivsi3.S 2020/04/23 03:12:49 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: udivsi3.S,v 1.5 2020/04/22 11:58:26 rin Exp $ */ 1/* $NetBSD: udivsi3.S,v 1.6 2020/04/23 03:12:49 rin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990 The Regents of the University of California. 4 * Copyright (c) 1990 The Regents of the University of California.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer 8 * the Systems Programming Group of the University of Utah Computer
9 * Science Department. 9 * Science Department.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -29,33 +29,33 @@ @@ -29,33 +29,33 @@
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 */ 34 */
35 35
36#include <machine/asm.h> 36#include <machine/asm.h>
37 37
38#if defined(LIBC_SCCS) && !defined(lint) 38#if defined(LIBC_SCCS) && !defined(lint)
39#if 0 39#if 0
40 RCSID("from: @(#)udivsi3.s 5.1 (Berkeley) 6/7/90") 40 RCSID("from: @(#)udivsi3.s 5.1 (Berkeley) 6/7/90")
41#else 41#else
42 RCSID("$NetBSD: udivsi3.S,v 1.5 2020/04/22 11:58:26 rin Exp $") 42 RCSID("$NetBSD: udivsi3.S,v 1.6 2020/04/23 03:12:49 rin Exp $")
43#endif 43#endif
44#endif /* LIBC_SCCS and not lint */ 44#endif /* LIBC_SCCS and not lint */
45 45
46/* unsigned / unsigned */ 46/* unsigned / unsigned */
47#ifndef __mc68010__ 47#ifndef __mc68010__
48#error 48/* XXX sun3 need this for bootloader */
49ENTRY(__udivsi3) 49ENTRY(__udivsi3)
50 movel 4(%sp),%d0 50 movel 4(%sp),%d0
51 divul 8(%sp),%d0 51 divul 8(%sp),%d0
52 rts 52 rts
53END(__udivsi3) 53END(__udivsi3)
54#else 54#else
55ENTRY(__udivsi3) 55ENTRY(__udivsi3)
56 movel %d2, -(%sp) | save %d2 56 movel %d2, -(%sp) | save %d2
57 movel 12(%sp), %d0 | load divisor 57 movel 12(%sp), %d0 | load divisor
58 movel 8(%sp), %d1 | load dividend 58 movel 8(%sp), %d1 | load dividend
59 59
60| first, we divide the divisor and dividend by two until  60| first, we divide the divisor and dividend by two until
61| the divisor fits into 16 bits: 61| the divisor fits into 16 bits: