bnsize00.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 1995 Colin Plumb. All rights reserved.
  3. * For licensing and other legal details, see the file legal.c.
  4. *
  5. * bnsize00.h - pick the correct machine word size to use.
  6. */
  7. #include "lbn.h" /* Get basic information */
  8. #if !BNSIZE64 && !BNSIZE32 && !BNSIZE16 && defined(BNWORD64)
  9. # if defined(BNWORD128) || (defined(lbnMulAdd1_64) && defined(lbnMulSub1_64))
  10. # define BNSIZE64 1
  11. # elif defined(mul64_ppmm) || defined(mul64_ppmma) || defined(mul64_ppmmaa)
  12. # define BNSIZE64 1
  13. # endif
  14. #endif
  15. #if !BNSIZE64 && !BNSIZE32 && !BNSIZE16 && defined(BNWORD32)
  16. # if defined(BNWORD64) || (defined(lbnMulAdd1_32) && defined(lbnMulSub1_32))
  17. # define BNSIZE32 1
  18. # elif defined(mul32_ppmm) || defined(mul32_ppmma) || defined(mul32_ppmmaa)
  19. # define BNSIZE32 1
  20. # endif
  21. #endif
  22. #if !BNSIZE64 && !BNSIZE32 && !BNSIZE16 && defined(BNWORD16)
  23. # if defined(BNWORD32) || (defined(lbnMulAdd1_16) && defined(lbnMulSub1_16))
  24. # define BNSIZE16 1
  25. # elif defined(mul16_ppmm) || defined(mul16_ppmma) || defined(mul16_ppmmaa)
  26. # define BNSIZE16 1
  27. # endif
  28. #endif
  29. #if !BNSIZE64 && !BNSIZE32 && !BNSIZE16
  30. #error Unable to find a viable word size to compile bignum library.
  31. #endif