1184251Smarcel/* gmp-mparam.h -- Compiler/machine parameter header file.
2184251Smarcel
3184251SmarcelCopyright 1991, 1993, 1994, 1999-2003, 2009, 2010 Free Software Foundation,
4184251SmarcelInc.
5184251Smarcel
6184251SmarcelThis file is part of the GNU MP Library.
7184251Smarcel
8184251SmarcelThe GNU MP Library is free software; you can redistribute it and/or modify
9184251Smarcelit under the terms of either:
10184251Smarcel
11184251Smarcel  * the GNU Lesser General Public License as published by the Free
12184251Smarcel    Software Foundation; either version 3 of the License, or (at your
13184251Smarcel    option) any later version.
14184251Smarcel
15184251Smarcelor
16184251Smarcel
17184251Smarcel  * the GNU General Public License as published by the Free Software
18184251Smarcel    Foundation; either version 2 of the License, or (at your option) any
19184251Smarcel    later version.
20184251Smarcel
21184251Smarcelor both in parallel, as here.
22184251Smarcel
23184251SmarcelThe GNU MP Library is distributed in the hope that it will be useful, but
24184251SmarcelWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25184251Smarcelor FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26184251Smarcelfor more details.
27184251Smarcel
28184251SmarcelYou should have received copies of the GNU General Public License and the
29184251SmarcelGNU Lesser General Public License along with the GNU MP Library.  If not,
30184251Smarcelsee https://www.gnu.org/licenses/.  */
31184251Smarcel
32184251Smarcel#define GMP_LIMB_BITS 32
33184251Smarcel#define GMP_LIMB_BYTES 4
34184251Smarcel
35184251Smarcel/* 1193MHz ARM (gcc55.fsffrance.org) */
36184251Smarcel
37184251Smarcel#define DIVREM_1_NORM_THRESHOLD              0  /* preinv always */
38184251Smarcel#define DIVREM_1_UNNORM_THRESHOLD            0  /* always */
39184251Smarcel#define MOD_1_NORM_THRESHOLD                 0  /* always */
40184251Smarcel#define MOD_1_UNNORM_THRESHOLD               0  /* always */
41184251Smarcel#define MOD_1N_TO_MOD_1_1_THRESHOLD         56
42184251Smarcel#define MOD_1U_TO_MOD_1_1_THRESHOLD         11
43184251Smarcel#define MOD_1_1_TO_MOD_1_2_THRESHOLD         0  /* never mpn_mod_1_1p */
44184251Smarcel#define MOD_1_2_TO_MOD_1_4_THRESHOLD     MP_SIZE_T_MAX
45184251Smarcel#define PREINV_MOD_1_TO_MOD_1_THRESHOLD     71
46184251Smarcel#define USE_PREINV_DIVREM_1                  1  /* preinv always */
47184251Smarcel#define DIVREM_2_THRESHOLD                   0  /* preinv always */
48184251Smarcel#define DIVEXACT_1_THRESHOLD                 0  /* always */
49184251Smarcel#define BMOD_1_TO_MOD_1_THRESHOLD           41
50184251Smarcel
51184251Smarcel#define MUL_TOOM22_THRESHOLD                36
52184251Smarcel#define MUL_TOOM33_THRESHOLD               125
53184251Smarcel#define MUL_TOOM44_THRESHOLD               193
54184251Smarcel#define MUL_TOOM6H_THRESHOLD               303
55184251Smarcel#define MUL_TOOM8H_THRESHOLD               418
56184251Smarcel
57184251Smarcel#define MUL_TOOM32_TO_TOOM43_THRESHOLD     125
58184251Smarcel#define MUL_TOOM32_TO_TOOM53_THRESHOLD     176
59184251Smarcel#define MUL_TOOM42_TO_TOOM53_THRESHOLD     114
60184251Smarcel#define MUL_TOOM42_TO_TOOM63_THRESHOLD     129
61184251Smarcel
62184251Smarcel#define SQR_BASECASE_THRESHOLD              12
63184251Smarcel#define SQR_TOOM2_THRESHOLD                 78
64184251Smarcel#define SQR_TOOM3_THRESHOLD                137
65184251Smarcel#define SQR_TOOM4_THRESHOLD                212
66184251Smarcel#define SQR_TOOM6_THRESHOLD                306
67184251Smarcel#define SQR_TOOM8_THRESHOLD                422
68184251Smarcel
69184251Smarcel#define MULMOD_BNM1_THRESHOLD               20
70184251Smarcel#define SQRMOD_BNM1_THRESHOLD               26
71184251Smarcel
72184251Smarcel#define MUL_FFT_MODF_THRESHOLD             436  /* k = 5 */
73184251Smarcel#define MUL_FFT_TABLE3                                      \
74184251Smarcel  { {    436, 5}, {     27, 6}, {     28, 7}, {     15, 6}, \
75184251Smarcel    {     32, 7}, {     17, 6}, {     35, 7}, {     19, 6}, \
76184251Smarcel    {     39, 7}, {     29, 8}, {     15, 7}, {     35, 8}, \
77184251Smarcel    {     19, 7}, {     41, 8}, {     23, 7}, {     49, 8}, \
78    {     27, 9}, {     15, 8}, {     31, 7}, {     63, 8}, \
79    {    256, 9}, {    512,10}, {   1024,11}, {   2048,12}, \
80    {   4096,13}, {   8192,14}, {  16384,15}, {  32768,16} }
81#define MUL_FFT_TABLE3_SIZE 28
82#define MUL_FFT_THRESHOLD                 5760
83
84#define SQR_FFT_MODF_THRESHOLD             404  /* k = 5 */
85#define SQR_FFT_TABLE3                                      \
86  { {    404, 5}, {     13, 4}, {     27, 5}, {     27, 6}, \
87    {     28, 7}, {     15, 6}, {     32, 7}, {     17, 6}, \
88    {     35, 7}, {     29, 8}, {     15, 7}, {     35, 8}, \
89    {     19, 7}, {     41, 8}, {     23, 7}, {     47, 8}, \
90    {     27, 9}, {     15, 8}, {     39, 9}, {    512,10}, \
91    {   1024,11}, {   2048,12}, {   4096,13}, {   8192,14}, \
92    {  16384,15}, {  32768,16} }
93#define SQR_FFT_TABLE3_SIZE 26
94#define SQR_FFT_THRESHOLD                 3776
95
96#define MULLO_BASECASE_THRESHOLD             0  /* always */
97#define MULLO_DC_THRESHOLD                 137
98#define MULLO_MUL_N_THRESHOLD            11479
99
100#define DC_DIV_QR_THRESHOLD                150
101#define DC_DIVAPPR_Q_THRESHOLD             494
102#define DC_BDIV_QR_THRESHOLD               148
103#define DC_BDIV_Q_THRESHOLD                345
104
105#define INV_MULMOD_BNM1_THRESHOLD           70
106#define INV_NEWTON_THRESHOLD               474
107#define INV_APPR_THRESHOLD                 478
108
109#define BINV_NEWTON_THRESHOLD              542
110#define REDC_1_TO_REDC_N_THRESHOLD         117
111
112#define MU_DIV_QR_THRESHOLD               2089
113#define MU_DIVAPPR_Q_THRESHOLD            2172
114#define MUPI_DIV_QR_THRESHOLD              225
115#define MU_BDIV_QR_THRESHOLD              1528
116#define MU_BDIV_Q_THRESHOLD               2089
117
118#define MATRIX22_STRASSEN_THRESHOLD         16
119#define HGCD_THRESHOLD                     197
120#define GCD_DC_THRESHOLD                   902
121#define GCDEXT_DC_THRESHOLD                650
122#define JACOBI_BASE_METHOD                   2
123
124#define GET_STR_DC_THRESHOLD                20
125#define GET_STR_PRECOMPUTE_THRESHOLD        39
126#define SET_STR_DC_THRESHOLD              1045
127#define SET_STR_PRECOMPUTE_THRESHOLD      2147
128