diff options
author | Niels M?ller <nisse@lysator.liu.se> | 2019-08-16 08:00:46 +0200 |
---|---|---|
committer | Niels M?ller <nisse@lysator.liu.se> | 2019-08-16 08:00:46 +0200 |
commit | 694d0c60b43d40bd18bcf5dda6ba1181cedd1324 (patch) | |
tree | 889630dee3f2aac7e0cc85cdb7d8f893cd216094 /gmp-impl.h | |
parent | 58b80c88cdbd0af5ebcec9f731f93b74db8d9d1b (diff) | |
download | gmp-694d0c60b43d40bd18bcf5dda6ba1181cedd1324.tar.gz |
New function mpn_gcd_22.
* mpn/generic/gcd.c (gcd_2): Moved to gcd_22.c below.
(mpn_gcd): Adapt for calling gcd_22.
* mpn/generic/gcd_22.c (mpn_gcd_22): New file and function.
* gmp-impl.h (mp_double_limb_t): New (typedef) struct.
* configure.ac (gmp_mpn_functions): Added gcd_22.
* tests/mpn/t-gcd_22.c: New test.
* tests/mpn/Makefile.am (check_PROGRAMS): Add t-gcd_22.
* tests/refmpz.c (refmpz_gcd): New function (plain binary gcd).
Diffstat (limited to 'gmp-impl.h')
-rw-r--r-- | gmp-impl.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gmp-impl.h b/gmp-impl.h index 5c72c5968..293defd8a 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -3968,6 +3968,14 @@ __GMP_DECLSPEC void __gmp_invalid_operation (void) ATTRIBUTE_NORETURN; #define PP_FIRST_OMITTED 3 #endif +typedef struct +{ + mp_limb_t d0, d1; +} mp_double_limb_t; + +#define mpn_gcd_22 __MPN (gcd_22) +__GMP_DECLSPEC mp_double_limb_t mpn_gcd_22 (mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t); + /* BIT1 means a result value in bit 1 (second least significant bit), with a zero bit representing +1 and a one bit representing -1. Bits other than bit 1 are garbage. These are meant to be kept in "int"s, and casts are |