14a1767b4Smrg /* Intel P6 gmp-mparam.h -- Compiler/machine parameter header file.
24a1767b4Smrg 
3*f81b1c5bSmrg Copyright 1991, 1993, 1994, 1999-2003, 2008-2010, 2012 Free Software
4*f81b1c5bSmrg Foundation, Inc.
54a1767b4Smrg 
64a1767b4Smrg This file is part of the GNU MP Library.
74a1767b4Smrg 
84a1767b4Smrg The GNU MP Library is free software; you can redistribute it and/or modify
9*f81b1c5bSmrg it under the terms of either:
10*f81b1c5bSmrg 
11*f81b1c5bSmrg   * the GNU Lesser General Public License as published by the Free
12*f81b1c5bSmrg     Software Foundation; either version 3 of the License, or (at your
134a1767b4Smrg     option) any later version.
144a1767b4Smrg 
15*f81b1c5bSmrg or
16*f81b1c5bSmrg 
17*f81b1c5bSmrg   * the GNU General Public License as published by the Free Software
18*f81b1c5bSmrg     Foundation; either version 2 of the License, or (at your option) any
19*f81b1c5bSmrg     later version.
20*f81b1c5bSmrg 
21*f81b1c5bSmrg or both in parallel, as here.
22*f81b1c5bSmrg 
234a1767b4Smrg The GNU MP Library is distributed in the hope that it will be useful, but
244a1767b4Smrg WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25*f81b1c5bSmrg or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26*f81b1c5bSmrg for more details.
274a1767b4Smrg 
28*f81b1c5bSmrg You should have received copies of the GNU General Public License and the
29*f81b1c5bSmrg GNU Lesser General Public License along with the GNU MP Library.  If not,
30*f81b1c5bSmrg see https://www.gnu.org/licenses/.  */
314a1767b4Smrg 
324a1767b4Smrg 
334a1767b4Smrg #define GMP_LIMB_BITS 32
34*f81b1c5bSmrg #define GMP_LIMB_BYTES 4
354a1767b4Smrg 
364a1767b4Smrg 
37d25e02daSmrg /* NOTE: In a fat binary build SQR_TOOM2_THRESHOLD here cannot be more than the
38d25e02daSmrg    value in mpn/x86/p6/gmp-mparam.h.  The latter is used as a hard limit in
39d25e02daSmrg    mpn/x86/p6/sqr_basecase.asm.  */
404a1767b4Smrg 
414a1767b4Smrg 
42d25e02daSmrg /* 1867 MHz P6 model 13 */
434a1767b4Smrg 
44d25e02daSmrg #define MOD_1_NORM_THRESHOLD                 4
45d25e02daSmrg #define MOD_1_UNNORM_THRESHOLD               4
46d25e02daSmrg #define MOD_1N_TO_MOD_1_1_THRESHOLD          5
47d25e02daSmrg #define MOD_1U_TO_MOD_1_1_THRESHOLD          4
48d25e02daSmrg #define MOD_1_1_TO_MOD_1_2_THRESHOLD        11
49d25e02daSmrg #define MOD_1_2_TO_MOD_1_4_THRESHOLD         0  /* never mpn_mod_1s_2p */
50d25e02daSmrg #define PREINV_MOD_1_TO_MOD_1_THRESHOLD      8
51d25e02daSmrg #define USE_PREINV_DIVREM_1                  1  /* native */
52d25e02daSmrg #define DIV_QR_2_PI2_THRESHOLD           MP_SIZE_T_MAX  /* never */
53d25e02daSmrg #define DIVEXACT_1_THRESHOLD                 0  /* always (native) */
54d25e02daSmrg #define BMOD_1_TO_MOD_1_THRESHOLD           21
554a1767b4Smrg 
56d25e02daSmrg #define MUL_TOOM22_THRESHOLD                20
57d25e02daSmrg #define MUL_TOOM33_THRESHOLD                74
58d25e02daSmrg #define MUL_TOOM44_THRESHOLD               181
59d25e02daSmrg #define MUL_TOOM6H_THRESHOLD               252
60d25e02daSmrg #define MUL_TOOM8H_THRESHOLD               363
614a1767b4Smrg 
62d25e02daSmrg #define MUL_TOOM32_TO_TOOM43_THRESHOLD      73
63d25e02daSmrg #define MUL_TOOM32_TO_TOOM53_THRESHOLD     114
64d25e02daSmrg #define MUL_TOOM42_TO_TOOM53_THRESHOLD     115
65d25e02daSmrg #define MUL_TOOM42_TO_TOOM63_THRESHOLD      80
664a1767b4Smrg 
67d25e02daSmrg #define SQR_BASECASE_THRESHOLD               0  /* always (native) */
68d25e02daSmrg #define SQR_TOOM2_THRESHOLD                 30
69d25e02daSmrg #define SQR_TOOM3_THRESHOLD                101
70d25e02daSmrg #define SQR_TOOM4_THRESHOLD                154
71d25e02daSmrg #define SQR_TOOM6_THRESHOLD                222
72d25e02daSmrg #define SQR_TOOM8_THRESHOLD                527
734a1767b4Smrg 
74d25e02daSmrg #define MULMID_TOOM42_THRESHOLD             58
75d25e02daSmrg 
76d25e02daSmrg #define MULMOD_BNM1_THRESHOLD               13
77d25e02daSmrg #define SQRMOD_BNM1_THRESHOLD               17
78d25e02daSmrg 
79d25e02daSmrg #define POWM_SEC_TABLE  4,23,258,768,2388
80d25e02daSmrg 
81d25e02daSmrg #define MUL_FFT_MODF_THRESHOLD             565  /* k = 5 */
82d25e02daSmrg #define MUL_FFT_TABLE3                                      \
83d25e02daSmrg   { {    565, 5}, {     25, 6}, {     13, 5}, {     27, 6}, \
84d25e02daSmrg     {     25, 7}, {     13, 6}, {     28, 7}, {     15, 6}, \
85d25e02daSmrg     {     31, 7}, {     17, 6}, {     35, 7}, {     27, 8}, \
86d25e02daSmrg     {     15, 7}, {     35, 8}, {     19, 7}, {     41, 8}, \
87d25e02daSmrg     {     23, 7}, {     47, 8}, {     27, 9}, {     15, 8}, \
88d25e02daSmrg     {     31, 7}, {     63, 8}, {     39, 9}, {     23, 5}, \
89d25e02daSmrg     {    383, 4}, {    991, 5}, {    511, 6}, {    267, 7}, \
90d25e02daSmrg     {    157, 8}, {     91, 9}, {     47, 8}, {    111, 9}, \
91d25e02daSmrg     {     63, 8}, {    127, 9}, {     79,10}, {     47, 9}, \
92d25e02daSmrg     {     95,11}, {     31,10}, {     63, 9}, {    135,10}, \
93d25e02daSmrg     {     79, 9}, {    159,10}, {     95,11}, {     63,10}, \
94d25e02daSmrg     {    143, 9}, {    287,10}, {    159,11}, {     95,10}, \
95d25e02daSmrg     {    191,12}, {     63,11}, {    127,10}, {    255, 9}, \
96d25e02daSmrg     {    511,10}, {    271, 9}, {    543,10}, {    287,11}, \
97d25e02daSmrg     {    159,10}, {    335, 9}, {    671,11}, {    191,10}, \
98d25e02daSmrg     {    383, 9}, {    767,10}, {    399, 9}, {    799,10}, \
99d25e02daSmrg     {    415,11}, {    223,12}, {    127,11}, {    255,10}, \
100d25e02daSmrg     {    543, 9}, {   1087,11}, {    287,10}, {    607,11}, \
101d25e02daSmrg     {    319,10}, {    671,12}, {    191,11}, {    383,10}, \
102d25e02daSmrg     {    799,11}, {    415,10}, {    831,13}, {    127,12}, \
103d25e02daSmrg     {    255,11}, {    543,10}, {   1087,11}, {    607,10}, \
104d25e02daSmrg     {   1215,12}, {    319,11}, {    671,10}, {   1343,11}, \
105d25e02daSmrg     {    735,10}, {   1471,12}, {    383,11}, {    799,10}, \
106d25e02daSmrg     {   1599,11}, {    863,12}, {    447,11}, {    959,13}, \
107d25e02daSmrg     {    255,12}, {    511,11}, {   1087,12}, {    575,11}, \
108d25e02daSmrg     {   1215,12}, {    639,11}, {   1343,12}, {    703,11}, \
109d25e02daSmrg     {   1471,13}, {    383,12}, {    831,11}, {   1727,12}, \
110d25e02daSmrg     {    959,14}, {    255,13}, {    511,12}, {   1215,13}, \
111d25e02daSmrg     {    639,12}, {   1471,11}, {   2943,13}, {    767,12}, \
112d25e02daSmrg     {   1727,13}, {    895,12}, {   1919,14}, {    511,13}, \
113d25e02daSmrg     {   1023,12}, {   2111,13}, {   1151,12}, {   2431,13}, \
114d25e02daSmrg     {   1407,12}, {   2815,14}, {    767,13}, {   1663,12}, \
115d25e02daSmrg     {   3455,13}, {   8192,14}, {  16384,15}, {  32768,16} }
116d25e02daSmrg #define MUL_FFT_TABLE3_SIZE 132
117d25e02daSmrg #define MUL_FFT_THRESHOLD                 6784
118d25e02daSmrg 
119d25e02daSmrg #define SQR_FFT_MODF_THRESHOLD             472  /* k = 5 */
120d25e02daSmrg #define SQR_FFT_TABLE3                                      \
121d25e02daSmrg   { {    472, 5}, {     25, 6}, {     13, 5}, {     27, 6}, \
122d25e02daSmrg     {     25, 7}, {     13, 6}, {     27, 7}, {     15, 6}, \
123d25e02daSmrg     {     31, 7}, {     17, 6}, {     35, 7}, {     27, 8}, \
124d25e02daSmrg     {     15, 7}, {     35, 8}, {     19, 7}, {     41, 8}, \
125d25e02daSmrg     {     23, 7}, {     49, 8}, {     27, 9}, {     15, 8}, \
126d25e02daSmrg     {     39, 9}, {     23, 8}, {     51,10}, {     15, 9}, \
127d25e02daSmrg     {     31, 8}, {     63, 4}, {   1023, 8}, {     67, 9}, \
128d25e02daSmrg     {     39, 5}, {    639, 4}, {   1471, 6}, {    383, 7}, \
129d25e02daSmrg     {    209, 8}, {    119, 9}, {     63, 7}, {    255, 8}, \
130d25e02daSmrg     {    139, 9}, {     71, 8}, {    143, 9}, {     79,10}, \
131d25e02daSmrg     {     47, 9}, {     95,11}, {     31,10}, {     63, 9}, \
132d25e02daSmrg     {    135,10}, {     79, 9}, {    159, 8}, {    319, 9}, \
133d25e02daSmrg     {    167,10}, {     95,11}, {     63,10}, {    143, 9}, \
134d25e02daSmrg     {    287,10}, {    159,11}, {     95,10}, {    191,12}, \
135d25e02daSmrg     {     63,11}, {    127,10}, {    255, 9}, {    543, 8}, \
136d25e02daSmrg     {   1087,10}, {    287, 9}, {    575,11}, {    159,10}, \
137d25e02daSmrg     {    319, 9}, {    639,10}, {    335, 9}, {    671,10}, \
138d25e02daSmrg     {    351, 9}, {    703,11}, {    191,10}, {    383, 9}, \
139d25e02daSmrg     {    767,10}, {    399, 9}, {    799,10}, {    415, 9}, \
140d25e02daSmrg     {    831,11}, {    223,12}, {    127,11}, {    255,10}, \
141d25e02daSmrg     {    543, 9}, {   1087,11}, {    287,10}, {    607, 9}, \
142d25e02daSmrg     {   1215,11}, {    319,10}, {    671, 9}, {   1343,11}, \
143d25e02daSmrg     {    351,10}, {    703,12}, {    191,11}, {    383,10}, \
144d25e02daSmrg     {    799,11}, {    415,10}, {    831,13}, {    127,12}, \
145d25e02daSmrg     {    255,11}, {    543,10}, {   1087,11}, {    607,12}, \
146d25e02daSmrg     {    319,11}, {    671,10}, {   1343,11}, {    735,12}, \
147d25e02daSmrg     {    383,11}, {    799,10}, {   1599,11}, {    863,12}, \
148d25e02daSmrg     {    447,11}, {    959,13}, {    255,12}, {    511,11}, \
149d25e02daSmrg     {   1087,12}, {    575,11}, {   1215,12}, {    639,11}, \
150d25e02daSmrg     {   1343,12}, {    703,11}, {   1471,13}, {    383,12}, \
151d25e02daSmrg     {    767,11}, {   1599,12}, {    831,11}, {   1727,12}, \
152d25e02daSmrg     {    959,14}, {    255,13}, {    511,12}, {   1215,13}, \
153d25e02daSmrg     {    639,12}, {   1471,13}, {    767,12}, {   1727,13}, \
154d25e02daSmrg     {    895,12}, {   1919,14}, {    511,13}, {   1023,12}, \
155d25e02daSmrg     {   2111,13}, {   1151,12}, {   2431,13}, {   1407,14}, \
156d25e02daSmrg     {    767,13}, {   1663,12}, {   3455,13}, {   8192,14}, \
157d25e02daSmrg     {  16384,15}, {  32768,16} }
158d25e02daSmrg #define SQR_FFT_TABLE3_SIZE 146
159d25e02daSmrg #define SQR_FFT_THRESHOLD                 5760
160d25e02daSmrg 
161d25e02daSmrg #define MULLO_BASECASE_THRESHOLD             0  /* always */
162d25e02daSmrg #define MULLO_DC_THRESHOLD                  33
163d25e02daSmrg #define MULLO_MUL_N_THRESHOLD            13463
164d25e02daSmrg 
165d25e02daSmrg #define DC_DIV_QR_THRESHOLD                 20
166d25e02daSmrg #define DC_DIVAPPR_Q_THRESHOLD              56
167d25e02daSmrg #define DC_BDIV_QR_THRESHOLD                60
168d25e02daSmrg #define DC_BDIV_Q_THRESHOLD                134
169d25e02daSmrg 
170d25e02daSmrg #define INV_MULMOD_BNM1_THRESHOLD           38
171d25e02daSmrg #define INV_NEWTON_THRESHOLD                66
172d25e02daSmrg #define INV_APPR_THRESHOLD                  63
173d25e02daSmrg 
174d25e02daSmrg #define BINV_NEWTON_THRESHOLD              250
175d25e02daSmrg #define REDC_1_TO_REDC_N_THRESHOLD          63
176d25e02daSmrg 
177d25e02daSmrg #define MU_DIV_QR_THRESHOLD               1164
178d25e02daSmrg #define MU_DIVAPPR_Q_THRESHOLD             979
179d25e02daSmrg #define MUPI_DIV_QR_THRESHOLD               38
180d25e02daSmrg #define MU_BDIV_QR_THRESHOLD              1442
181d25e02daSmrg #define MU_BDIV_Q_THRESHOLD               1470
182d25e02daSmrg 
183d25e02daSmrg #define MATRIX22_STRASSEN_THRESHOLD         17
184d25e02daSmrg #define HGCD_THRESHOLD                      64
185d25e02daSmrg #define HGCD_APPR_THRESHOLD                105
186d25e02daSmrg #define HGCD_REDUCE_THRESHOLD             3524
187d25e02daSmrg #define GCD_DC_THRESHOLD                   386
188d25e02daSmrg #define GCDEXT_DC_THRESHOLD                309
1894a1767b4Smrg #define JACOBI_BASE_METHOD                   1
1904a1767b4Smrg 
191d25e02daSmrg #define GET_STR_DC_THRESHOLD                13
192d25e02daSmrg #define GET_STR_PRECOMPUTE_THRESHOLD        26
193d25e02daSmrg #define SET_STR_DC_THRESHOLD               587
194d25e02daSmrg #define SET_STR_PRECOMPUTE_THRESHOLD      1104
195