divsi3.S (31489a9a2653e123121e8ca39b4be802013d2b50) divsi3.S (f2e71517e0b886518f755b55931807a67478a564)
1/* $NetBSD: divsi3.S,v 1.4 2003/04/05 23:27:15 bjh21 Exp $ */
2
3/*
4 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
5 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
6 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
7 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
8 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL

--- 15 unchanged lines hidden (view full) ---

24
25ENTRY(__umodsi3)
26 stmfd sp!, {lr}
27 sub sp, sp, #4 /* align stack */
28 bl .L_udivide
29 add sp, sp, #4 /* unalign stack */
30 mov r0, r1
31 ldmfd sp!, {pc}
1/* $NetBSD: divsi3.S,v 1.4 2003/04/05 23:27:15 bjh21 Exp $ */
2
3/*
4 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
5 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
6 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
7 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
8 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL

--- 15 unchanged lines hidden (view full) ---

24
25ENTRY(__umodsi3)
26 stmfd sp!, {lr}
27 sub sp, sp, #4 /* align stack */
28 bl .L_udivide
29 add sp, sp, #4 /* unalign stack */
30 mov r0, r1
31 ldmfd sp!, {pc}
32END(__umodsi3)
32
33ENTRY(__modsi3)
34 stmfd sp!, {lr}
35 sub sp, sp, #4 /* align stack */
36 bl .L_divide
37 add sp, sp, #4 /* unalign stack */
38 mov r0, r1
39 ldmfd sp!, {pc}
40
41.L_overflow:
42#if !defined(_KERNEL) && !defined(_STANDALONE)
43 mov r0, #8 /* SIGFPE */
44 bl PIC_SYM(_C_LABEL(raise), PLT) /* raise it */
45 mov r0, #0
46#else
47 /* XXX should cause a fatal error */
48 mvn r0, #0
49#endif
50 RET
33
34ENTRY(__modsi3)
35 stmfd sp!, {lr}
36 sub sp, sp, #4 /* align stack */
37 bl .L_divide
38 add sp, sp, #4 /* unalign stack */
39 mov r0, r1
40 ldmfd sp!, {pc}
41
42.L_overflow:
43#if !defined(_KERNEL) && !defined(_STANDALONE)
44 mov r0, #8 /* SIGFPE */
45 bl PIC_SYM(_C_LABEL(raise), PLT) /* raise it */
46 mov r0, #0
47#else
48 /* XXX should cause a fatal error */
49 mvn r0, #0
50#endif
51 RET
52END(__modsi3)
51
52ENTRY(__udivsi3)
53.L_udivide: /* r0 = r0 / r1; r1 = r0 % r1 */
54 eor r0, r1, r0
55 eor r1, r0, r1
56 eor r0, r1, r0
57 /* r0 = r1 / r0; r1 = r1 % r0 */
58 cmp r0, #1

--- 6 unchanged lines hidden (view full) ---

65 movs r1, r1, lsr #1
66 orrcs ip, ip, #0x10000000 /* ip bit 0x10000000 = bit 0 of r1 */
67 b .L_divide_l1
68
69.L_divide_l0: /* r0 == 1 */
70 mov r0, r1
71 mov r1, #0
72 RET
53
54ENTRY(__udivsi3)
55.L_udivide: /* r0 = r0 / r1; r1 = r0 % r1 */
56 eor r0, r1, r0
57 eor r1, r0, r1
58 eor r0, r1, r0
59 /* r0 = r1 / r0; r1 = r1 % r0 */
60 cmp r0, #1

--- 6 unchanged lines hidden (view full) ---

67 movs r1, r1, lsr #1
68 orrcs ip, ip, #0x10000000 /* ip bit 0x10000000 = bit 0 of r1 */
69 b .L_divide_l1
70
71.L_divide_l0: /* r0 == 1 */
72 mov r0, r1
73 mov r1, #0
74 RET
75END(__udivsi3)
73
74ENTRY(__divsi3)
75.L_divide: /* r0 = r0 / r1; r1 = r0 % r1 */
76 eor r0, r1, r0
77 eor r1, r0, r1
78 eor r0, r1, r0
79 /* r0 = r1 / r0; r1 = r1 % r0 */
80 cmp r0, #1

--- 299 unchanged lines hidden (view full) ---

380 mov r1, r1, lsl #1
381 orrne r1, r1, #1
382 mov r3, r3, lsl #1
383 cmp r1, r0
384 subhs r1, r1, r0
385 addhs r3, r3, r2
386 mov r0, r3
387 RET
76
77ENTRY(__divsi3)
78.L_divide: /* r0 = r0 / r1; r1 = r0 % r1 */
79 eor r0, r1, r0
80 eor r1, r0, r1
81 eor r0, r1, r0
82 /* r0 = r1 / r0; r1 = r1 % r0 */
83 cmp r0, #1

--- 299 unchanged lines hidden (view full) ---

383 mov r1, r1, lsl #1
384 orrne r1, r1, #1
385 mov r3, r3, lsl #1
386 cmp r1, r0
387 subhs r1, r1, r0
388 addhs r3, r3, r2
389 mov r0, r3
390 RET
391END(__divsi3)