Initial commit
[wrt350n-kernel.git] / arch / alpha / math-emu / sfp-util.h
blobf53707f7745569c3a1ab48526ccf5d6753a1221e
1 #include <linux/kernel.h>
2 #include <linux/sched.h>
3 #include <linux/types.h>
4 #include <asm/byteorder.h>
5 #include <asm/fpu.h>
7 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
8 ((sl) = (al) + (bl), (sh) = (ah) + (bh) + ((sl) < (al)))
10 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
11 ((sl) = (al) - (bl), (sh) = (ah) - (bh) - ((al) < (bl)))
13 #define umul_ppmm(wh, wl, u, v) \
14 __asm__ ("mulq %2,%3,%1; umulh %2,%3,%0" \
15 : "=r" ((UDItype)(wh)), \
16 "=&r" ((UDItype)(wl)) \
17 : "r" ((UDItype)(u)), \
18 "r" ((UDItype)(v)))
20 #define udiv_qrnnd(q, r, n1, n0, d) \
21 do { unsigned long __r; \
22 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
23 (r) = __r; \
24 } while (0)
25 extern unsigned long __udiv_qrnnd (unsigned long *, unsigned long,
26 unsigned long , unsigned long);
28 #define UDIV_NEEDS_NORMALIZATION 1
30 #define abort() goto bad_insn
32 #ifndef __LITTLE_ENDIAN
33 #define __LITTLE_ENDIAN -1
34 #endif
35 #define __BYTE_ORDER __LITTLE_ENDIAN