[PARISC] import necessary bits of libgcc.a
[linux-2.6/lfs.git] / arch / parisc / lib / libgcc / __udivmodsi4.c
blob2a2fc28b2026014476a6f4eed37f2619fbdbc655
1 #include "libgcc.h"
3 u32 __udivmodsi4(u32 num, u32 den, u32 * rem_p)
5 u32 quot = 0, qbit = 1;
7 if (den == 0) {
8 BUG();
11 /* Left-justify denominator and count shift */
12 while ((s32) den >= 0) {
13 den <<= 1;
14 qbit <<= 1;
17 while (qbit) {
18 if (den <= num) {
19 num -= den;
20 quot += qbit;
22 den >>= 1;
23 qbit >>= 1;
26 if (rem_p)
27 *rem_p = num;
29 return quot;
31 EXPORT_SYMBOL(__udivmodsi4);