OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libc/] [machine/] [h8500/] [divhi3.S] - Blame information for rev 407

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
        .title "H8/500 DIVIDE"
2
!! 2 byte integer Divide code for the H8/500
3
!!
4
!! Steve Chamberlain
5
!! sac@cygnus.com
6
!!
7
!!
8
 
9
!! args in r1 and r4, result in r0/r1
10
 
11
#if __CODE__==32
12
#define RET prts
13
#else
14
#define RET rts
15
#endif
16
        .global __divmodhi4
17
 
18
 
19
__divmodhi4:
20
        clr.w   r0
21
        tst.w   r1      ! neg arg1
22
        bpl     PU
23
 
24
 
25
        neg.w   r1
26
NU:     tst.w   r4
27
        bmi     NN
28
 
29
NP:     divxu.w r4,r0
30
        neg.w   r0
31
        neg.w   r1
32
        RET
33
 
34
NN:     neg.w   r4
35
        divxu.w r4,r0
36
        neg.w   r0      ! get rem sign right
37
        RET
38
 
39
 
40
PU:
41
        tst.w   r4
42
        bpl     PP
43
 
44
 
45
PN:     neg.w   r4
46
        divxu.w r4,r0
47
        neg.w   r1
48
        RET
49
 
50
PP:     divxu.w r4,r0   ! rem in r0, q in r1
51
        RET
52
 
53
 
54
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.