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