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

Subversion Repositories or1k

[/] [or1k/] [tags/] [LINUX_2_4_26_OR32/] [linux/] [linux-2.4/] [include/] [asm-i386/] [div64.h] - Blame information for rev 1275

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

Line No. Rev Author Line
1 1275 phoenix
#ifndef __I386_DIV64
2
#define __I386_DIV64
3
 
4
#define do_div(n,base) ({ \
5
        unsigned long __upper, __low, __high, __mod; \
6
        asm("":"=a" (__low), "=d" (__high):"A" (n)); \
7
        __upper = __high; \
8
        if (__high) { \
9
                __upper = __high % (base); \
10
                __high = __high / (base); \
11
        } \
12
        asm("divl %2":"=a" (__low), "=d" (__mod):"rm" (base), "0" (__low), "1" (__upper)); \
13
        asm("":"=A" (n):"a" (__low),"d" (__high)); \
14
        __mod; \
15
})
16
 
17
#endif

powered by: WebSVN 2.1.0

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