1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26.global ___divsi3;
27.type ___divsi3, STT_FUNC;
28
29#ifdef CONFIG_ARITHMETIC_OPS_L1
30.section .l1.text
31#else
32.text
33#endif
34
35.align 2;
36___divsi3 :
37
38
39 R3 = R0 ^ R1;
40 R0 = ABS R0;
41
42 CC = V;
43
44 r3 = rot r3 by -1;
45 r1 = abs r1;
46
47
48 cc = r0 < r1;
49 if cc jump .Lret_zero;
50 r2 = r1 >> 15;
51 cc = r2;
52 if cc jump .Lidents;
53 r2 = r1 << 16;
54 cc = r2 <= r0;
55 if cc jump .Lidents;
56
57 DIVS(R0, R1);
58 DIVQ(R0, R1);
59 DIVQ(R0, R1);
60 DIVQ(R0, R1);
61 DIVQ(R0, R1);
62 DIVQ(R0, R1);
63 DIVQ(R0, R1);
64 DIVQ(R0, R1);
65 DIVQ(R0, R1);
66 DIVQ(R0, R1);
67 DIVQ(R0, R1);
68 DIVQ(R0, R1);
69 DIVQ(R0, R1);
70 DIVQ(R0, R1);
71 DIVQ(R0, R1);
72 DIVQ(R0, R1);
73 DIVQ(R0, R1);
74
75 R0 = R0.L (Z);
76 r1 = r3 >> 31;
77 r0 = r0 + r1;
78 r1 = -r0;
79 cc = bittst(r3, 30);
80 if cc r0 = r1;
81 RTS;
82
83
84
85
86
87.Lidents:
88 CC = R1 == 0;
89 IF CC JUMP .Lident_return;
90
91 CC = R0 == 0;
92 IF CC JUMP .Lzero_return;
93
94 CC = R0 == R1;
95 IF CC JUMP .Lident_return;
96
97 CC = R1 == 1;
98 IF CC JUMP .Lident_return;
99
100 R2.L = ONES R1;
101 R2 = R2.L (Z);
102 CC = R2 == 1;
103 IF CC JUMP .Lpower_of_two;
104
105
106
107
108
109 P1 = 31;
110
111 [--SP] = (R7:5);
112 R2 = -R1;
113 [--SP] = R2;
114 R2 = R0 << 1;
115 R6 = R0 ^ R1;
116 R5 = R6 >> 31;
117
118 R0 = 0 ;
119 R2 = R2 | R5;
120 R6 = R0 ^ R1;
121
122 LSETUP(.Llst,.Llend) LC0 = P1;
123.Llst: R7 = R2 >> 31;
124 R2 = R2 << 1;
125 R0 = R0 << 1 || R5 = [SP];
126 R0 = R0 | R7;
127 CC = R6 < 0;
128
129 IF CC R5 = R1;
130 R0 = R0 + R5;
131 R6 = R0 ^ R1;
132 R5 = R6 >> 31;
133
134 BITTGL(R5,0);
135.Llend: R2 = R2 + R5;
136
137
138 r1 = r3 >> 31;
139 r2 = r2 + r1;
140 cc = bittst(r3,30);
141 r0 = -r2;
142 if !cc r0 = r2;
143 SP += 4;
144 (R7:5)= [SP++];
145 RTS;
146
147.Lident_return:
148 CC = R1 == 0;
149 R2 = -1 (X);
150 R2 >>= 1;
151 IF CC JUMP .Ltrue_ident_return;
152
153 CC = R0 == R1;
154 R2 = 1 (Z);
155 IF CC JUMP .Ltrue_ident_return;
156
157 R2 = R0;
158
159
160.Ltrue_ident_return:
161 R0 = R2;
162 R2 = -R2;
163 CC = bittst(R3,30);
164 IF CC R0 = R2;
165.Lzero_return:
166 RTS;
167
168.Lpower_of_two:
169
170
171
172
173
174
175
176
177
178
179
180 R2 = R0 >> 31;
181 CC = R1 < 0;
182 IF CC JUMP .Ltrue_ident_return;
183
184 R1.l = SIGNBITS R1;
185 R1 = R1.L (Z);
186 R1 += -30;
187 R0 = LSHIFT R0 by R1.L;
188 r1 = r3 >> 31;
189 r0 = r0 + r1;
190 R2 = -R0;
191 CC = bittst(R3,30);
192 IF CC R0 = R2;
193 RTS;
194
195.Lret_zero:
196 R0 = 0;
197 RTS;
198
199.size ___divsi3, .-___divsi3
200