sfp-util.h 1008 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <linux/kernel.h>
  3. #include <linux/sched.h>
  4. #include <linux/types.h>
  5. #include <asm/byteorder.h>
  6. #include <asm/fpu.h>
  7. #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
  8. ((sl) = (al) + (bl), (sh) = (ah) + (bh) + ((sl) < (al)))
  9. #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
  10. ((sl) = (al) - (bl), (sh) = (ah) - (bh) - ((al) < (bl)))
  11. #define umul_ppmm(wh, wl, u, v) \
  12. __asm__ ("mulq %2,%3,%1; umulh %2,%3,%0" \
  13. : "=r" ((UDItype)(wh)), \
  14. "=&r" ((UDItype)(wl)) \
  15. : "r" ((UDItype)(u)), \
  16. "r" ((UDItype)(v)))
  17. #define udiv_qrnnd(q, r, n1, n0, d) \
  18. do { unsigned long __r; \
  19. (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
  20. (r) = __r; \
  21. } while (0)
  22. extern unsigned long __udiv_qrnnd (unsigned long *, unsigned long,
  23. unsigned long , unsigned long);
  24. #define UDIV_NEEDS_NORMALIZATION 1
  25. #define abort() goto bad_insn
  26. #ifndef __LITTLE_ENDIAN
  27. #define __LITTLE_ENDIAN -1
  28. #endif
  29. #define __BYTE_ORDER __LITTLE_ENDIAN