2009-01-18 10:15:25 -05:00
|
|
|
/* Fat binary x86 gmp-mparam.h -- Compiler/machine parameter header file.
|
|
|
|
|
|
|
|
Copyright 1991, 1993, 1994, 2000, 2001, 2002, 2003 Free Software Foundation,
|
|
|
|
Inc.
|
|
|
|
|
|
|
|
This file is part of the GNU MP Library.
|
|
|
|
|
|
|
|
The GNU MP Library is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or (at your
|
|
|
|
option) any later version.
|
|
|
|
|
|
|
|
The GNU MP Library is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with the GNU MP Library; see the file COPYING.LIB. If not, write to
|
|
|
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA. */
|
|
|
|
|
2009-01-18 14:52:40 -05:00
|
|
|
#define BITS_PER_MP_LIMB 64
|
|
|
|
#define BYTES_PER_MP_LIMB 8
|
2009-01-18 10:15:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
/* mpn_divexact_1 is faster than mpn_divrem_1 at all sizes. The only time
|
|
|
|
this might not be true currently is for actual 80386 and 80486 chips,
|
|
|
|
where mpn/x86/dive_1.asm might be slower than mpn/x86/divrem_1.asm, but
|
|
|
|
that's not worth worrying about. */
|
|
|
|
#define DIVEXACT_1_THRESHOLD 0
|
|
|
|
|
|
|
|
/* Only some of the x86s have an mpn_preinv_divrem_1, but we set
|
|
|
|
USE_PREINV_DIVREM_1 so that all callers use it, and then let the
|
|
|
|
__gmpn_cpuvec pointer go to plain mpn_divrem_1 if there's not an actual
|
|
|
|
preinv. */
|
|
|
|
#define USE_PREINV_DIVREM_1 1
|
|
|
|
|
|
|
|
/* mpn_sqr_basecase is faster than mpn_mul_basecase at all sizes, no need
|
|
|
|
for mpn_sqr_n to call the latter. */
|
|
|
|
#define SQR_BASECASE_THRESHOLD 0
|
|
|
|
|
|
|
|
/* Sensible fallbacks for these, when not taken from a cpu-specific
|
|
|
|
gmp-mparam.h. */
|
|
|
|
#define MUL_KARATSUBA_THRESHOLD 20
|
|
|
|
#define MUL_TOOM3_THRESHOLD 130
|
2011-06-08 06:46:43 -04:00
|
|
|
#define MUL_TOOM4_THRESHOLD 426
|
|
|
|
#define MUL_TOOM7_THRESHOLD 507
|
2009-01-18 10:15:25 -05:00
|
|
|
#define SQR_KARATSUBA_THRESHOLD 30
|
|
|
|
#define SQR_TOOM3_THRESHOLD 200
|
2011-06-08 06:46:43 -04:00
|
|
|
#define SQR_TOOM4_THRESHOLD 662
|
|
|
|
#define SQR_TOOM7_THRESHOLD 1300
|
2009-01-18 10:15:25 -05:00
|
|
|
|
|
|
|
/* These are values more or less in the middle of what the typical x86 chips
|
|
|
|
come out as. For a fat binary it's necessary to have values for these,
|
|
|
|
since the defaults for MUL_FFT_TABLE and SQR_FFT_TABLE otherwise come out
|
|
|
|
as non-constant array initializers. FIXME: Perhaps these should be done
|
|
|
|
in the cpuvec structure like other thresholds. */
|
2011-06-08 06:46:43 -04:00
|
|
|
#define MUL_FFT_TABLE { 464, 1056, 3264, 3840, 7168, 28672, 114688, 327680, 0 }
|
|
|
|
#define MUL_FFT_MODF_THRESHOLD 496
|
|
|
|
#define MUL_FFT_THRESHOLD 5888
|
|
|
|
|
|
|
|
#define SQR_FFT_TABLE { 688, 928, 2752, 3328, 7168, 28672, 114688, 327680, 0 }
|
|
|
|
#define SQR_FFT_MODF_THRESHOLD 688
|
|
|
|
#define SQR_FFT_THRESHOLD 4864
|
|
|
|
|
|
|
|
#define MUL_FFT_TABLE2 {{1, 3}, {205, 4}, {377, 5}, {386, 4}, {404, 5}, {813, 6}, {850, 5}, {869, 6}, {971, 5}, {993, 6}, {2392, 7}, {2445, 6}, {2668, 7}, {2727, 6}, {2787, 7}, {2976, 6}, {3042, 7}, {3109, 6}, {3178, 7}, {3248, 8}, {3393, 7}, {3468, 8}, {3544, 7}, {3784, 8}, {3867, 6}, {3952, 7}, {4039, 8}, {4407, 7}, {4504, 8}, {4914, 7}, {5022, 8}, {6957, 9}, {7756, 8}, {8460, 9}, {8836, 8}, {9030, 9}, {9850, 8}, {10513, 9}, {11976, 8}, {12239, 9}, {13939, 8}, {14245, 9}, {15876, 8}, {16224, 9}, {22461, 10}, {23970, 9}, {26142, 10}, {27898, 9}, {28509, 10}, {31772, 9}, {33906, 10}, {36184, 9}, {36977, 10}, {40326, 9}, {41210, 10}, {44943, 11}, {45928, 10}, {46934, 11}, {47962, 10}, {57042, 11}, {62207, 12}, {63570, 10}, {73983, 11}, {80681, 10}, {86099, 11}, {98051, 10}, {102394, 11}, {114110, 12}, {127165, 11}, {164920, 12}, {196129, 11}, {228243, 12}, {233241, 13}, {254354, 12}, {259924, 11}, {277377, 12}, {456509, 13}, {519871, 12}, {659749, 13}, {784582, 14}, {MP_SIZE_T_MAX,0}}
|
|
|
|
|
|
|
|
#define MUL_FFTM_TABLE2 {{1, 4}, {344, 5}, {360, 4}, {377, 5}, {743, 6}, {777, 5}, {813, 6}, {850, 5}, {869, 6}, {1612, 7}, {1685, 6}, {1760, 7}, {1922, 6}, {2009, 7}, {3867, 6}, {3952, 7}, {4504, 8}, {4603, 7}, {4808, 8}, {4914, 7}, {5022, 8}, {5132, 7}, {5360, 8}, {5478, 7}, {5598, 8}, {6518, 9}, {6661, 8}, {7266, 9}, {9850, 8}, {10066, 9}, {14876, 10}, {15535, 9}, {18480, 10}, {19722, 9}, {21047, 10}, {21508, 9}, {22461, 10}, {23970, 9}, {25032, 10}, {27898, 9}, {28509, 10}, {31772, 9}, {32468, 10}, {36184, 9}, {36977, 10}, {44943, 11}, {47962, 10}, {52305, 11}, {55819, 10}, {57042, 11}, {62207, 12}, {63570, 10}, {67840, 11}, {72397, 10}, {73983, 11}, {80681, 10}, {82448, 11}, {114110, 12}, {127165, 11}, {147989, 12}, {161386, 11}, {172223, 12}, {196129, 11}, {204813, 12}, {228243, 13}, {254354, 12}, {259924, 11}, {265616, 12}, {329862, 13}, {392279, 12}, {456509, 13}, {466506, 14}, {508731, 13}, {519871, 12}, {554776, 13}, {913042, 14}, {MP_SIZE_T_MAX,0}}
|
|
|
|
|
|
|
|
#define SQR_FFT_TABLE2 {{1, 4}, {344, 5}, {360, 4}, {377, 5}, {386, 4}, {404, 5}, {813, 6}, {850, 5}, {869, 6}, {2144, 7}, {2191, 6}, {2289, 7}, {2340, 6}, {2392, 7}, {2445, 6}, {2499, 7}, {2610, 6}, {2668, 7}, {2727, 8}, {2849, 7}, {3248, 8}, {3393, 7}, {3784, 8}, {3867, 6}, {4039, 7}, {4128, 8}, {6957, 9}, {7756, 8}, {8460, 9}, {8836, 8}, {9030, 9}, {9850, 8}, {10066, 9}, {11976, 8}, {12239, 9}, {13939, 10}, {14876, 9}, {15876, 8}, {16224, 9}, {18084, 10}, {19722, 9}, {22461, 10}, {23970, 9}, {26142, 10}, {27898, 9}, {28509, 10}, {31772, 9}, {32468, 10}, {36184, 9}, {36977, 10}, {44943, 11}, {47962, 10}, {57042, 11}, {62207, 12}, {63570, 10}, {73983, 11}, {80681, 10}, {86099, 11}, {114110, 12}, {127165, 11}, {164920, 12}, {196129, 11}, {213882, 12}, {218566, 13}, {254354, 12}, {259924, 11}, {277377, 12}, {456509, 13}, {519871, 12}, {659749, 13}, {784582, 14}, {MP_SIZE_T_MAX,0}}
|
|
|
|
|
|
|
|
#define SQR_FFTM_TABLE2 {{1, 4}, {306, 5}, {328, 4}, {344, 5}, {360, 4}, {377, 5}, {680, 6}, {711, 5}, {743, 6}, {777, 5}, {813, 6}, {1476, 7}, {1543, 6}, {1612, 7}, {1685, 6}, {1760, 7}, {3867, 6}, {3952, 7}, {4312, 8}, {4407, 7}, {4504, 8}, {4704, 7}, {4808, 8}, {4914, 7}, {5022, 8}, {5132, 7}, {5360, 8}, {5478, 7}, {5598, 8}, {6518, 9}, {6661, 8}, {7266, 9}, {14876, 10}, {15535, 9}, {16944, 10}, {17696, 9}, {18084, 10}, {19722, 9}, {21047, 10}, {21508, 9}, {22461, 10}, {23970, 9}, {24495, 10}, {27898, 9}, {28509, 10}, {31772, 9}, {32468, 10}, {44943, 11}, {47962, 10}, {52305, 11}, {55819, 10}, {57042, 11}, {62207, 12}, {63570, 10}, {67840, 11}, {72397, 10}, {73983, 11}, {80681, 10}, {82448, 11}, {89912, 12}, {91881, 11}, {93893, 12}, {95949, 11}, {114110, 12}, {127165, 11}, {147989, 12}, {161386, 11}, {172223, 12}, {228243, 13}, {254354, 12}, {329862, 13}, {392279, 12}, {456509, 13}, {466506, 14}, {508731, 13}, {519871, 12}, {554776, 13}, {913042, 14}, {MP_SIZE_T_MAX,0}}
|
|
|
|
|
|
|
|
#define MUL_FFT_FULL_TABLE2 {{16, 1}, {1092, 2}, {1116, 1}, {1811, 2}, {1851, 1}, {2066, 4}, {2112, 1}, {2207, 2}, {2256, 1}, {2462, 2}, {2516, 1}, {2572, 2}, {2629, 1}, {2869, 2}, {2932, 1}, {3343, 4}, {3417, 1}, {3648, 4}, {3728, 1}, {3894, 2}, {4068, 3}, {4158, 2}, {4440, 5}, {4638, 4}, {4844, 1}, {4951, 4}, {5060, 3}, {5171, 2}, {5401, 4}, {5520, 2}, {5765, 4}, {6154, 2}, {6568, 3}, {6712, 2}, {6859, 1}, {7010, 4}, {7482, 1}, {7814, 4}, {7986, 6}, {8161, 4}, {8710, 6}, {9096, 5}, {9296, 1}, {10140, 3}, {10363, 2}, {10590, 1}, {10822, 4}, {11059, 2}, {11302, 1}, {11803, 4}, {12327, 1}, {13155, 3}, {13444, 1}, {14040, 2}, {14348, 1}, {15993, 2}, {16344, 1}, {17068, 2}, {17824, 1}, {18215, 3}, {18614, 1}, {20300, 3}, {20745, 1}, {22140, 2}, {22625, 1}, {23628, 2}, {24146, 4}, {25216, 1}, {25769, 3}, {26911, 1}, {32708, 2}, {33425, 1}, {36452, 4}, {38901, 1}, {40624, 3}, {41514, 1}, {44303, 2}, {47280, 4}, {50456, 1}, {52691, 3}, {53845, 1}, {57462, 4}, {61321, 1}, {62664, 2}, {64037, 1}, {65440, 2}, {66873, 5}, {68338, 8}, {69835, 4}, {71365, 6}, {72928, 5}, {74525, 4}, {79530, 1}, {81272, 3}, {83052, 1}, {84871, 3}, {86730, 1}, {88630, 2}, {94582, 1}, {96654, 2}, {98771, 4}, {100934, 6}, {103145, 9}, {107713, 5}, {110072, 1}, {114947, 4}, {122667, 1}, {130905, 2}, {145881, 5}, {149076, 6}, {152341, 4}, {155677, 1}, {162570, 3}, {166130, 1}, {169768, 3}, {173486, 1}, {177285, 2}, {197567, 4}, {206315, 3}, {215450, 1}, {261830, 2}, {267564, 5}, {273423, 8}, {279411, 9}, {291783, 7}, {298173, 6}, {304703, 4}, {325163, 3}, {346997, 2}, {395159, 4}, {403812, 7}, {412655, 10}, {430925, 8}, {440362, 6}, {450005, 5}, {469929, 1}, {523686, 2}, {583592, 5}, {596372, 6}, {609431, 4}, {650350, 3}, {694016, 2}, {790340, 1}, {MP_SIZE_T_MAX,0}}
|
|
|
|
|
|
|
|
#define SQR_FFT_FULL_TABLE2 {{16, 2}, {1022, 1}, {1045, 2}, {1068, 1}, {1092, 2}, {1116, 1}, {1219, 2}, {1274, 1}, {1811, 2}, {1851, 1}, {1934, 2}, {1977, 1}, {2066, 2}, {2112, 1}, {2207, 2}, {2256, 1}, {2462, 2}, {2516, 1}, {2572, 2}, {2629, 1}, {3343, 4}, {3417, 1}, {3894, 2}, {4068, 3}, {4158, 2}, {4440, 5}, {4740, 4}, {4844, 1}, {4951, 3}, {5171, 2}, {5401, 4}, {5520, 2}, {5765, 4}, {6154, 6}, {6289, 2}, {6427, 4}, {6568, 3}, {6712, 4}, {7482, 1}, {7814, 4}, {7986, 6}, {8161, 4}, {8710, 2}, {8901, 5}, {9296, 1}, {9922, 2}, {10140, 3}, {10363, 2}, {10590, 1}, {10822, 4}, {11059, 1}, {11803, 4}, {12597, 1}, {12873, 2}, {13155, 3}, {13444, 1}, {14040, 4}, {14348, 2}, {14663, 4}, {14985, 1}, {15993, 2}, {16344, 1}, {17068, 2}, {17824, 1}, {18215, 3}, {18614, 1}, {20300, 3}, {20745, 1}, {22140, 2}, {22625, 1}, {23628, 2}, {24146, 4}, {24675, 1}, {25769, 3}, {26911, 1}, {28720, 2}, {29349, 4}, {29992, 1}, {32007, 2}, {33425, 1}, {34905, 2}, {35670, 1}, {36452, 4}, {37251, 1}, {40624, 3}, {41514, 1}, {44303, 2}, {45274, 1}, {47280, 4}, {50456, 1}, {52691, 3}, {53845, 1}, {57462, 2}, {60007, 4}, {61321, 1}, {62664, 2}, {64037, 1}, {65440, 2}, {66873, 5}, {68338, 8}, {69835, 7}, {71365, 8}, {72928, 5}, {74525, 6}, {76157, 4}, {79530, 1}, {81272, 3}, {83052, 1}, {84871, 3}, {86730, 1}, {88630, 2}, {94582, 4}, {96654, 2}, {98771, 4}, {100934, 6}, {103145, 9}, {107713, 5}, {112483, 1}, {114947, 4}, {122667, 1}, {130905, 2}, {142755, 5}, {145881, 7}, {149076, 6}, {152341, 4}, {155677, 1}, {159086, 4}, {162570, 3}, {166130, 2}, {169768, 3}, {173486, 2}, {197567, 4}, {206315, 3}, {215450, 1}, {261830, 2}, {267564, 5}, {273423, 8}, {279411, 9}, {291783, 7}, {298173, 6}, {304703, 4}, {325163, 3}, {346997, 2}, {395159, 4}, {403812, 7}, {412655, 10}, {430925, 6}, {450005, 5}, {469929, 1}, {523686, 2}, {583592, 5}, {596372, 6}, {609431, 4}, {650350, 3}, {694016, 2}, {790340, 1}, {MP_SIZE_T_MAX,0}}
|