diff options
author | Niels M?ller <nisse@lysator.liu.se> | 2019-09-23 17:26:46 +0200 |
---|---|---|
committer | Niels M?ller <nisse@lysator.liu.se> | 2019-09-23 17:26:46 +0200 |
commit | 5149e9a3ff21e81edcf59825c3e31d2dbbef6a0a (patch) | |
tree | 944487c77dcfb17466fd11ff689f8897faaef978 /gmp-impl.h | |
parent | b4b615920b330e37aa4b806674bbeb7a5a284195 (diff) | |
download | gmp-5149e9a3ff21e81edcf59825c3e31d2dbbef6a0a.tar.gz |
Make tuning of hgcd and gcd take hgcd2 choice into account
* gmp-impl.h (hgcd2_func_t) [TUNE_PROGRAM_BUILD]: New typedef.
(hgcd2_func) [TUNE_PROGRAM_BUILD]: New function pointer.
* tune/hgcd2.c (mpn_hgcd2): New file, with a redefined function to
invoke an implementation via the hgcd2_func function pointer.
Initially points to the default implementation in
mpn/generic/hgcd2.c.
* tune/Makefile.am (tuneup_SOURCES): Add hgcd2.c.
* tune/tuneup.c (one_method): Return index of selected function.
(tune_hgcd2): Set hgcd2_func to point to selected function. So
that the later tuning of mpn_hgcd and mpn_gcd uses the right
implementation of hgcd2.
Diffstat (limited to 'gmp-impl.h')
-rw-r--r-- | gmp-impl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gmp-impl.h b/gmp-impl.h index 6e155a4af..f73618aee 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -4949,6 +4949,10 @@ extern mp_size_t redc_1_to_redc_n_threshold; #define MATRIX22_STRASSEN_THRESHOLD matrix22_strassen_threshold extern mp_size_t matrix22_strassen_threshold; +typedef int hgcd2_func_t (mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t, + struct hgcd_matrix1 *); +extern hgcd2_func_t *hgcd2_func; + #undef HGCD_THRESHOLD #define HGCD_THRESHOLD hgcd_threshold extern mp_size_t hgcd_threshold; |