1/* PowerPC-32 gmp-mparam.h -- Compiler/machine parameter header file.
2
3Copyright 2002, 2004, 2009, 2010 Free Software Foundation, Inc.
4
5This file is part of the GNU MP Library.
6
7The GNU MP Library is free software; you can redistribute it and/or modify
8it under the terms of either:
9
10  * the GNU Lesser General Public License as published by the Free
11    Software Foundation; either version 3 of the License, or (at your
12    option) any later version.
13
14or
15
16  * the GNU General Public License as published by the Free Software
17    Foundation; either version 2 of the License, or (at your option) any
18    later version.
19
20or both in parallel, as here.
21
22The GNU MP Library is distributed in the hope that it will be useful, but
23WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
25for more details.
26
27You should have received copies of the GNU General Public License and the
28GNU Lesser General Public License along with the GNU MP Library.  If not,
29see https://www.gnu.org/licenses/.  */
30
31#define GMP_LIMB_BITS 32
32#define GMP_LIMB_BYTES 4
33
34
35/* This file is used for 75x (G3) and for 7400/7410 (G4), both which have
36   much slow multiply instructions.  */
37
38/* 450 MHz PPC 7400 */
39
40#define DIVREM_1_NORM_THRESHOLD              0  /* always */
41#define DIVREM_1_UNNORM_THRESHOLD            0  /* always */
42#define MOD_1_NORM_THRESHOLD                 3
43#define MOD_1_UNNORM_THRESHOLD               0  /* always */
44#define MOD_1N_TO_MOD_1_1_THRESHOLD         11
45#define MOD_1U_TO_MOD_1_1_THRESHOLD          7
46#define MOD_1_1_TO_MOD_1_2_THRESHOLD        11
47#define MOD_1_2_TO_MOD_1_4_THRESHOLD        18
48#define PREINV_MOD_1_TO_MOD_1_THRESHOLD     38
49#define USE_PREINV_DIVREM_1                  1
50#define DIVEXACT_1_THRESHOLD                 0  /* always */
51#define BMOD_1_TO_MOD_1_THRESHOLD        MP_SIZE_T_MAX  /* never */
52
53#define MUL_TOOM22_THRESHOLD                10
54#define MUL_TOOM33_THRESHOLD                38
55#define MUL_TOOM44_THRESHOLD                99
56#define MUL_TOOM6H_THRESHOLD               141
57#define MUL_TOOM8H_THRESHOLD               212
58
59#define MUL_TOOM32_TO_TOOM43_THRESHOLD      65
60#define MUL_TOOM32_TO_TOOM53_THRESHOLD      69
61#define MUL_TOOM42_TO_TOOM53_THRESHOLD      65
62#define MUL_TOOM42_TO_TOOM63_THRESHOLD      66
63
64#define SQR_BASECASE_THRESHOLD               4
65#define SQR_TOOM2_THRESHOLD                 18
66#define SQR_TOOM3_THRESHOLD                 57
67#define SQR_TOOM4_THRESHOLD                142
68#define SQR_TOOM6_THRESHOLD                173
69#define SQR_TOOM8_THRESHOLD                309
70
71#define MULMOD_BNM1_THRESHOLD                9
72#define SQRMOD_BNM1_THRESHOLD               11
73
74#define MUL_FFT_MODF_THRESHOLD             220  /* k = 5 */
75#define MUL_FFT_TABLE3                                      \
76  { {    220, 5}, {     13, 6}, {      7, 5}, {     15, 6}, \
77    {      8, 5}, {     17, 6}, {      9, 5}, {     19, 6}, \
78    {     13, 7}, {      7, 6}, {     17, 7}, {      9, 6}, \
79    {     19, 7}, {     11, 6}, {     23, 7}, {     13, 8}, \
80    {      7, 7}, {     19, 8}, {     11, 7}, {     23, 9}, \
81    {      7, 8}, {     15, 7}, {     33, 8}, {     19, 7}, \
82    {     39, 8}, {     23, 9}, {     15, 8}, {     39, 9}, \
83    {     23, 8}, {     47,10}, {     15, 9}, {     31, 8}, \
84    {     67, 9}, {     55,10}, {     31, 9}, {     63, 8}, \
85    {    127, 7}, {    255, 9}, {     71, 8}, {    143, 7}, \
86    {    287, 9}, {     79,10}, {     47, 9}, {     95,11}, \
87    {     31,10}, {     63, 9}, {    127, 8}, {    255, 9}, \
88    {    143, 8}, {    287,10}, {     79, 9}, {    159, 8}, \
89    {    319, 9}, {    175, 8}, {    351, 7}, {    703,10}, \
90    {     95, 9}, {    191, 8}, {    383, 9}, {    207,10}, \
91    {    111,11}, {     63,10}, {    127, 9}, {    255,10}, \
92    {    143, 9}, {    287, 8}, {    575,10}, {    159, 9}, \
93    {    319,10}, {    175, 9}, {    351, 8}, {    703,11}, \
94    {     95,10}, {    191, 9}, {    383,10}, {    207, 9}, \
95    {    415, 8}, {    831,12}, {     63,11}, {    127,10}, \
96    {    255, 9}, {    511,10}, {    271, 9}, {    543,10}, \
97    {    287, 9}, {    575,11}, {    159,10}, {    351, 9}, \
98    {    703, 8}, {   1407,11}, {    191,10}, {    415, 9}, \
99    {    831,11}, {    223,10}, {    447, 9}, {    895,12}, \
100    {    127,11}, {    255,10}, {    543,11}, {    287,10}, \
101    {    575,11}, {    351,10}, {    703, 9}, {   1407,12}, \
102    {    191,11}, {    415,10}, {    831,11}, {    447,10}, \
103    {    895,13}, {    127,12}, {    255,11}, {    543,10}, \
104    {   1087,11}, {    575,12}, {    319,11}, {    703,10}, \
105    {   1407,12}, {    383,11}, {    831,12}, {    447,11}, \
106    {    895,10}, {   1791,11}, {    959,13}, {    255,12}, \
107    {    511,11}, {   1087,12}, {    575,11}, {   1215,12}, \
108    {    703,11}, {   1407,13}, {    383,12}, {    895,11}, \
109    {   1791,12}, {    959,14}, {    255,13}, {    511,12}, \
110    {   1215,13}, {    639,12}, {   1407,13}, {    895,12}, \
111    {   1919,14}, {    511,13}, {   1023,12}, {   2047,13}, \
112    {   1151,12}, {   2303,13}, {   1407,14}, {    767,13}, \
113    {   1919,10}, {  15359,12}, {   4096,13}, {   8192,14}, \
114    {  16384,15}, {  32768,16} }
115#define MUL_FFT_TABLE3_SIZE 154
116#define MUL_FFT_THRESHOLD                 2688
117
118#define SQR_FFT_MODF_THRESHOLD             184  /* k = 5 */
119#define SQR_FFT_TABLE3                                      \
120  { {    184, 5}, {      6, 4}, {     13, 5}, {     13, 6}, \
121    {      7, 5}, {     15, 6}, {     13, 7}, {      7, 6}, \
122    {     16, 7}, {      9, 6}, {     19, 7}, {     11, 6}, \
123    {     23, 7}, {     13, 8}, {      7, 7}, {     19, 8}, \
124    {     11, 7}, {     25, 9}, {      7, 8}, {     15, 7}, \
125    {     31, 8}, {     19, 7}, {     39, 8}, {     27, 9}, \
126    {     15, 8}, {     39, 9}, {     23,10}, {     15, 9}, \
127    {     31, 8}, {     63, 9}, {     39, 8}, {     79, 9}, \
128    {     47, 8}, {     95,10}, {     31, 9}, {     63, 8}, \
129    {    127, 7}, {    255, 9}, {     71, 8}, {    143, 7}, \
130    {    287, 9}, {     79, 8}, {    159,10}, {     47, 9}, \
131    {     95,11}, {     31,10}, {     63, 9}, {    127, 8}, \
132    {    255, 9}, {    143, 8}, {    287, 7}, {    575,10}, \
133    {     79, 9}, {    159, 8}, {    319, 9}, {    175, 8}, \
134    {    351,10}, {     95, 9}, {    191, 8}, {    383, 9}, \
135    {    207,10}, {    111,11}, {     63,10}, {    127, 9}, \
136    {    255,10}, {    143, 9}, {    287, 8}, {    575,10}, \
137    {    159, 9}, {    319,10}, {    175, 9}, {    351,11}, \
138    {     95,10}, {    191, 9}, {    383,10}, {    207, 9}, \
139    {    415, 8}, {    831,10}, {    223,12}, {     63,11}, \
140    {    127,10}, {    255, 9}, {    511,10}, {    287, 9}, \
141    {    575,11}, {    159,10}, {    351, 9}, {    703,11}, \
142    {    191,10}, {    415, 9}, {    831,11}, {    223,10}, \
143    {    447, 9}, {    895,12}, {    127,11}, {    255,10}, \
144    {    511,11}, {    287,10}, {    575,11}, {    319,10}, \
145    {    639,11}, {    351,10}, {    703, 9}, {   1407,12}, \
146    {    191,11}, {    383,10}, {    767,11}, {    415,10}, \
147    {    831,11}, {    447,10}, {    895,13}, {    127,12}, \
148    {    255,11}, {    511,10}, {   1023,11}, {    575,12}, \
149    {    319,11}, {    703,10}, {   1407,12}, {    383,11}, \
150    {    831,12}, {    447,11}, {    895,10}, {   1791,11}, \
151    {    959,13}, {    255,12}, {    511,11}, {   1023,12}, \
152    {    575,11}, {   1215,12}, {    703,11}, {   1407,13}, \
153    {    383,12}, {    895,11}, {   1791,12}, {    959,14}, \
154    {    255,13}, {    511,12}, {   1215,13}, {    639,12}, \
155    {   1471,13}, {    767,12}, {   1535,13}, {    895,12}, \
156    {   1919,14}, {    511,13}, {   1151,12}, {   2431,13}, \
157    {   1407,14}, {    767,13}, {   1919,15}, {  32768,16} }
158#define SQR_FFT_TABLE3_SIZE 152
159#define SQR_FFT_THRESHOLD                 1728
160
161#define MULLO_BASECASE_THRESHOLD             0  /* always */
162#define MULLO_DC_THRESHOLD                  33
163#define MULLO_MUL_N_THRESHOLD             5240
164
165#define DC_DIV_QR_THRESHOLD                 31
166#define DC_DIVAPPR_Q_THRESHOLD             108
167#define DC_BDIV_QR_THRESHOLD                35
168#define DC_BDIV_Q_THRESHOLD                 88
169
170#define INV_MULMOD_BNM1_THRESHOLD           42
171#define INV_NEWTON_THRESHOLD               149
172#define INV_APPR_THRESHOLD                 125
173
174#define BINV_NEWTON_THRESHOLD              156
175#define REDC_1_TO_REDC_N_THRESHOLD          39
176
177#define MU_DIV_QR_THRESHOLD                807
178#define MU_DIVAPPR_Q_THRESHOLD             807
179#define MUPI_DIV_QR_THRESHOLD               66
180#define MU_BDIV_QR_THRESHOLD               667
181#define MU_BDIV_Q_THRESHOLD                807
182
183#define MATRIX22_STRASSEN_THRESHOLD         11
184#define HGCD_THRESHOLD                      87
185#define GCD_DC_THRESHOLD                   233
186#define GCDEXT_DC_THRESHOLD                198
187#define JACOBI_BASE_METHOD                   1
188
189#define GET_STR_DC_THRESHOLD                12
190#define GET_STR_PRECOMPUTE_THRESHOLD        28
191#define SET_STR_DC_THRESHOLD               390
192#define SET_STR_PRECOMPUTE_THRESHOLD       814
193