diff options
author | Kevin Ryde <user42@zip.com.au> | 2004-01-02 20:36:51 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2004-01-02 20:36:51 +0100 |
commit | 71ada500b2e154584cd56e3a76130c5d32238acc (patch) | |
tree | f7eeac0fb0078ae820c211bc0bd7ab93fd4c6538 /longlong.h | |
parent | 0f716cfb9158be2b7905addcf9de6500e63665a5 (diff) | |
download | gmp-71ada500b2e154584cd56e3a76130c5d32238acc.tar.gz |
* longlong.h (umul_ppmm) [generic]: Add comments about squaring
(dropped from tasks list)
Diffstat (limited to 'longlong.h')
-rw-r--r-- | longlong.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/longlong.h b/longlong.h index b01876633..1cfd900e0 100644 --- a/longlong.h +++ b/longlong.h @@ -1557,7 +1557,16 @@ extern UWtype mpn_udiv_qrnnd_r _PROTO ((UWtype, UWtype, UWtype, UWtype *)); } while (0) #endif -/* If we still don't have umul_ppmm, define it using plain C. */ +/* If we still don't have umul_ppmm, define it using plain C. + + For reference, when this code is used for squaring (ie. u and v identical + expressions), gcc recognises __x1 and __x2 are the same and generates 3 + multiplies, not 4. The subsequent additions could be optimized a bit, + but the only place GMP currently uses such a square is mpn_sqr_basecase, + and chips obliged to use this generic C umul will have plenty of worse + performance problems than a couple of extra instructions on the diagonal + of sqr_basecase. */ + #if !defined (umul_ppmm) #define umul_ppmm(w1, w0, u, v) \ do { \ |