1 /* Intel P55 gmp-mparam.h -- Compiler/machine parameter header file.
2 
3 Copyright 1991, 1993, 1994, 1999-2002, 2004, 2009, 2010 Free Software
4 Foundation, Inc.
5 
6 This file is part of the GNU MP Library.
7 
8 The GNU MP Library is free software; you can redistribute it and/or modify
9 it under the terms of either:
10 
11   * the GNU Lesser General Public License as published by the Free
12     Software Foundation; either version 3 of the License, or (at your
13     option) any later version.
14 
15 or
16 
17   * the GNU General Public License as published by the Free Software
18     Foundation; either version 2 of the License, or (at your option) any
19     later version.
20 
21 or both in parallel, as here.
22 
23 The GNU MP Library is distributed in the hope that it will be useful, but
24 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26 for more details.
27 
28 You should have received copies of the GNU General Public License and the
29 GNU Lesser General Public License along with the GNU MP Library.  If not,
30 see https://www.gnu.org/licenses/.  */
31 
32 
33 #define GMP_LIMB_BITS 32
34 #define GMP_LIMB_BYTES 4
35 
36 
37 /* For mpn/x86/pentium/mod_1.asm */
38 #define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
39 
40 
41 /* 233MHz P55 */
42 
43 #define MOD_1_NORM_THRESHOLD                 5
44 #define MOD_1_UNNORM_THRESHOLD           MP_SIZE_T_MAX  /* never */
45 #define MOD_1N_TO_MOD_1_1_THRESHOLD      MP_SIZE_T_MAX  /* never */
46 #define MOD_1U_TO_MOD_1_1_THRESHOLD         12
47 #define MOD_1_1_TO_MOD_1_2_THRESHOLD         0
48 #define MOD_1_2_TO_MOD_1_4_THRESHOLD        11
49 #define PREINV_MOD_1_TO_MOD_1_THRESHOLD     63
50 #define USE_PREINV_DIVREM_1                  0
51 #define DIVEXACT_1_THRESHOLD                 0  /* always (native) */
52 #define BMOD_1_TO_MOD_1_THRESHOLD           51
53 
54 #define MUL_TOOM22_THRESHOLD                16
55 #define MUL_TOOM33_THRESHOLD                53
56 #define MUL_TOOM44_THRESHOLD               128
57 #define MUL_TOOM6H_THRESHOLD               189
58 #define MUL_TOOM8H_THRESHOLD               260
59 
60 #define MUL_TOOM32_TO_TOOM43_THRESHOLD      89
61 #define MUL_TOOM32_TO_TOOM53_THRESHOLD      91
62 #define MUL_TOOM42_TO_TOOM53_THRESHOLD      90
63 #define MUL_TOOM42_TO_TOOM63_THRESHOLD      88
64 
65 #define SQR_BASECASE_THRESHOLD               0  /* always (native) */
66 #define SQR_TOOM2_THRESHOLD                 20
67 #define SQR_TOOM3_THRESHOLD                 73
68 #define SQR_TOOM4_THRESHOLD                178
69 #define SQR_TOOM6_THRESHOLD                210
70 #define SQR_TOOM8_THRESHOLD                375
71 
72 #define MULMOD_BNM1_THRESHOLD               11
73 #define SQRMOD_BNM1_THRESHOLD               12
74 
75 #define MUL_FFT_MODF_THRESHOLD             364  /* k = 5 */
76 #define MUL_FFT_TABLE3                                      \
77   { {    364, 5}, {     15, 6}, {      8, 5}, {     17, 6}, \
78     {      9, 5}, {     19, 6}, {     17, 7}, {      9, 6}, \
79     {     21, 7}, {     11, 6}, {     23, 7}, {     15, 6}, \
80     {     31, 7}, {     21, 8}, {     11, 7}, {     27, 8}, \
81     {     15, 7}, {     33, 8}, {     19, 7}, {     39, 8}, \
82     {     23, 7}, {     47, 8}, {     27, 9}, {     15, 8}, \
83     {     31, 7}, {     63, 8}, {     39, 9}, {     23, 8}, \
84     {     47,10}, {     15, 9}, {     31, 8}, {     67, 9}, \
85     {     39, 8}, {     79, 9}, {     47, 8}, {     95, 9}, \
86     {     55,10}, {     31, 9}, {     79,10}, {     47, 9}, \
87     {     95,11}, {     31,10}, {     63, 9}, {    135,10}, \
88     {     79, 9}, {    159, 8}, {    319, 9}, {    167,10}, \
89     {     95, 9}, {    191, 8}, {    383,11}, {     63,10}, \
90     {    127, 9}, {    255,10}, {    143, 9}, {    287,10}, \
91     {    159, 9}, {    319,11}, {     95,10}, {    191, 9}, \
92     {    383,12}, {     63,11}, {    127,10}, {    271, 9}, \
93     {    543,10}, {    287,11}, {    159,10}, {    351,11}, \
94     {    191,10}, {    415,11}, {    223,12}, {    127,11}, \
95     {    255,10}, {    511,11}, {    287,10}, {    575,11}, \
96     {    351,12}, {    191,11}, {    415,13}, {    127,12}, \
97     {    255,11}, {    575,12}, {    319,11}, {    703,12}, \
98     {    383,11}, {    831,12}, {    447,13}, {   8192,14}, \
99     {  16384,15}, {  32768,16} }
100 #define MUL_FFT_TABLE3_SIZE 90
101 #define MUL_FFT_THRESHOLD                 3520
102 
103 #define SQR_FFT_MODF_THRESHOLD             340  /* k = 5 */
104 #define SQR_FFT_TABLE3                                      \
105   { {    340, 5}, {     17, 6}, {      9, 5}, {     19, 6}, \
106     {     17, 7}, {      9, 6}, {     21, 7}, {     11, 6}, \
107     {     23, 7}, {     15, 6}, {     31, 7}, {     21, 8}, \
108     {     11, 7}, {     29, 8}, {     15, 7}, {     33, 8}, \
109     {     19, 7}, {     39, 8}, {     27, 7}, {     55, 9}, \
110     {     15, 8}, {     31, 7}, {     65, 8}, {     43, 9}, \
111     {     23, 8}, {     47,10}, {     15, 9}, {     31, 8}, \
112     {     67, 9}, {     39, 8}, {     83, 9}, {     47, 8}, \
113     {     95,10}, {     31, 9}, {     63, 8}, {    127, 9}, \
114     {     79,10}, {     47, 9}, {     95,11}, {     31,10}, \
115     {     63, 9}, {    127, 8}, {    255, 9}, {    135,10}, \
116     {     79, 9}, {    159, 8}, {    319,10}, {     95, 9}, \
117     {    191,11}, {     63,10}, {    127, 9}, {    255, 8}, \
118     {    511, 9}, {    271,10}, {    143, 9}, {    287, 8}, \
119     {    575, 9}, {    303,10}, {    159, 9}, {    319,11}, \
120     {     95,10}, {    191, 9}, {    383,10}, {    207,12}, \
121     {     63,11}, {    127,10}, {    271, 9}, {    543,10}, \
122     {    287, 9}, {    575,10}, {    303,11}, {    159,10}, \
123     {    351,11}, {    191,10}, {    415,11}, {    223,10}, \
124     {    447,12}, {    127,11}, {    255,10}, {    543,11}, \
125     {    287,10}, {    607,11}, {    351,12}, {    191,11}, \
126     {    479,13}, {    127,12}, {    255,11}, {    575,12}, \
127     {    319,11}, {    703,12}, {    383,11}, {    767,12}, \
128     {    447,13}, {   8192,14}, {  16384,15}, {  32768,16} }
129 #define SQR_FFT_TABLE3_SIZE 96
130 #define SQR_FFT_THRESHOLD                 5504
131 
132 #define MULLO_BASECASE_THRESHOLD             0  /* always */
133 #define MULLO_DC_THRESHOLD                  48
134 #define MULLO_MUL_N_THRESHOLD             6633
135 
136 #define DC_DIV_QR_THRESHOLD                 43
137 #define DC_DIVAPPR_Q_THRESHOLD             170
138 #define DC_BDIV_QR_THRESHOLD                43
139 #define DC_BDIV_Q_THRESHOLD                110
140 
141 #define INV_MULMOD_BNM1_THRESHOLD           30
142 #define INV_NEWTON_THRESHOLD               177
143 #define INV_APPR_THRESHOLD                 171
144 
145 #define BINV_NEWTON_THRESHOLD              194
146 #define REDC_1_TO_REDC_N_THRESHOLD          50
147 
148 #define MU_DIV_QR_THRESHOLD               1142
149 #define MU_DIVAPPR_Q_THRESHOLD            1142
150 #define MUPI_DIV_QR_THRESHOLD               90
151 #define MU_BDIV_QR_THRESHOLD               942
152 #define MU_BDIV_Q_THRESHOLD               1017
153 
154 #define MATRIX22_STRASSEN_THRESHOLD         13
155 #define HGCD_THRESHOLD                      92
156 #define GCD_DC_THRESHOLD                   283
157 #define GCDEXT_DC_THRESHOLD                221
158 #define JACOBI_BASE_METHOD                   2
159 
160 #define GET_STR_DC_THRESHOLD                18
161 #define GET_STR_PRECOMPUTE_THRESHOLD        31
162 #define SET_STR_DC_THRESHOLD               490
163 #define SET_STR_PRECOMPUTE_THRESHOLD       994
164