2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
10 * Don't use this one in new code
12 #define do_div64_32(res, high, low, base) ({ \
13 unsigned long __quot, __mod; \
14 unsigned long __cf, __tmp, __tmp2, __i; \
16 __asm__(".set push\n\t" \
18 ".set noreorder\n\t" \
24 "sll $1, %0, 0x1\n\t" \
25 "srl %3, %0, 0x1f\n\t" \
27 "sll %1, %1, 0x1\n\t" \
31 "sltu %5, %0, %z6\n\t" \
34 " addiu %4,%4,-1\n\t" \
35 "subu %0, %0, %z6\n\t" \
39 " srl %5, %1, 0x1f\n\t" \
41 : "=&r" (__mod), "=&r" (__tmp), "=&r" (__quot), "=&r" (__cf), \
42 "=&r" (__i), "=&r" (__tmp2) \
43 : "Jr" (base), "0" (high), "1" (low)); \
49 * Hey, we're already 64-bit, no
50 * need to play games..
52 #define do_div(n,base) ({ \
54 __res = ((unsigned long) n) % (unsigned) base; \
55 n = ((unsigned long) n) / (unsigned) base; \
58 #endif /* _ASM_DIV64_H */