lbn68000.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 1995 Colin Plumb. All rights reserved.
  3. * For licensing and other legal details, see the file legal.c.
  4. *
  5. * lbn68000.h - 16-bit bignum primitives for the 68000 (or 68010) processors.
  6. *
  7. * These primitives use little-endian word order.
  8. * (The order of bytes within words is irrelevant.)
  9. */
  10. #define BN_LITTLE_ENDIAN 1
  11. typedef unsigned short bnword16
  12. #define BNWORD16 bnword16
  13. bnword16 lbnSub1_16(bnword16 *num, unsigned len, bnword16 borrow);
  14. bnword16 lbnAdd1_16(bnword16 *num, unsigned len, bnword16 carry);
  15. void lbnMulN1_16(bnword16 *out, bnword16 const *in, unsigned len, bnword16 k);
  16. bnword16
  17. lbnMulAdd1_16(bnword16 *out, bnword16 const *in, unsigned len, bnword16 k);
  18. bnword16
  19. lbnMulSub1_16(bnword16 *out, bnword16 const *in, unsigned len, bnword16 k);
  20. bnword16 lbnDiv21_16(bnword16 *q, bnword16 nh, bnword16 nl, bnword16 d);
  21. unsigned lbnModQ_16(bnword16 const *n, unsigned len, bnword16 d);
  22. int is68020(void);
  23. /* #define the values to exclude the C versions */
  24. #define lbnSub1_16 lbnSub1_16
  25. #define lbnAdd1_16 lbnAdd1_16
  26. #define lbnMulN1_16 lbnMulN1_16
  27. #define lbnMulAdd1_16 lbnMulAdd1_16
  28. #define lbnMulSub1_16 lbnMulSub1_16
  29. #define lbnDiv21_16 lbnDiv21_16
  30. #define lbnModQ_16 lbnModQ_16
  31. /* Also include the 68020 definitions for 16/32 bit switching versions. */
  32. #include <lbn68020.h>