diff options
author | Niels M?ller <nisse@lysator.liu.se> | 2019-09-04 21:46:41 +0200 |
---|---|---|
committer | Niels M?ller <nisse@lysator.liu.se> | 2019-09-04 21:46:41 +0200 |
commit | 95d545683e958f411d896cc9ae55507c144a063a (patch) | |
tree | 394105f2853efc7b25dc90943651fb5a26644643 /tune/hgcd2-2.c | |
parent | 74469d71e6792fccdfb17f2913aaabafb7094a89 (diff) | |
download | gmp-95d545683e958f411d896cc9ae55507c144a063a.tar.gz |
Tuneup support for HGCD2_METHOD, controlling div1 usage in mpn_hgcd2.
* mpn/generic/hgcd2.c (HGCD2_METHOD): New parameter.
(DIV1): New macro, using either the div1 function or plain
division, depending on the value of HGCD2_METHOD.
(mpn_hgcd2): Use DIV1.
* tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
measuring of mpn_hgcd2 methods.
* tune/hgcd2-1.c, tune/hgcd2-2.c: New files.
* tune/tuneup.c: Tune HGCD2_METHOD.
Diffstat (limited to 'tune/hgcd2-2.c')
-rw-r--r-- | tune/hgcd2-2.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tune/hgcd2-2.c b/tune/hgcd2-2.c new file mode 100644 index 000000000..aa045dd7b --- /dev/null +++ b/tune/hgcd2-2.c @@ -0,0 +1,39 @@ +/* mpn/generic/hgcd2.c method 2. + +Copyright 2019 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 either: + + * the GNU Lesser General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at your + option) any later version. + +or + + * the GNU General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any + later version. + +or both in parallel, as here. + +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 General Public License +for more details. + +You should have received copies of the GNU General Public License and the +GNU Lesser General Public License along with the GNU MP Library. If not, +see https://www.gnu.org/licenses/. */ + +#include "gmp-impl.h" + +#undef HGCD2_METHOD +#define HGCD2_METHOD 2 +#define __gmpn_hgcd2 mpn_hgcd2_2 +/* Not used, but renamed to not get duplicate definitions */ +#define __gmpn_hgcd_mul_matrix1_vector mpn_hgcd_mul_matrix1_vector_2 + +#include "mpn/generic/hgcd2.c" |