sfp-util.h 969 B

123456789101112131415161718192021222324252627282930313233343536
  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. #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
  7. ((sl) = (al) + (bl), (sh) = (ah) + (bh) + ((sl) < (al)))
  8. #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
  9. ((sl) = (al) - (bl), (sh) = (ah) - (bh) - ((al) < (bl)))
  10. #define umul_ppmm(wh, wl, u, v) \
  11. __asm__ ("mulq %2,%3,%1; umulh %2,%3,%0" \
  12. : "=r" ((UDItype)(wh)), \
  13. "=&r" ((UDItype)(wl)) \
  14. : "r" ((UDItype)(u)), \
  15. "r" ((UDItype)(v)))
  16. #define udiv_qrnnd(q, r, n1, n0, d) \
  17. do { unsigned long __r; \
  18. (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
  19. (r) = __r; \
  20. } while (0)
  21. extern unsigned long __udiv_qrnnd (unsigned long *, unsigned long,
  22. unsigned long , unsigned long);
  23. #define UDIV_NEEDS_NORMALIZATION 1
  24. #define abort() goto bad_insn
  25. #ifndef __LITTLE_ENDIAN
  26. #define __LITTLE_ENDIAN -1
  27. #endif
  28. #define __BYTE_ORDER __LITTLE_ENDIAN