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