aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/math-emu/sfp-util.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/alpha/math-emu/sfp-util.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/alpha/math-emu/sfp-util.h')
-rw-r--r--arch/alpha/math-emu/sfp-util.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/alpha/math-emu/sfp-util.h b/arch/alpha/math-emu/sfp-util.h
new file mode 100644
index 000000000000..f53707f77455
--- /dev/null
+++ b/arch/alpha/math-emu/sfp-util.h
@@ -0,0 +1,35 @@
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>
6
7#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
8 ((sl) = (al) + (bl), (sh) = (ah) + (bh) + ((sl) < (al)))
9
10#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
11 ((sl) = (al) - (bl), (sh) = (ah) - (bh) - ((al) < (bl)))
12
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)))
19
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)
25extern unsigned long __udiv_qrnnd (unsigned long *, unsigned long,
26 unsigned long , unsigned long);
27
28#define UDIV_NEEDS_NORMALIZATION 1
29
30#define abort() goto bad_insn
31
32#ifndef __LITTLE_ENDIAN
33#define __LITTLE_ENDIAN -1
34#endif
35#define __BYTE_ORDER __LITTLE_ENDIAN