diff options
author | tege <tege@gmplib.org> | 1999-09-28 17:47:10 +0200 |
---|---|---|
committer | tege <tege@gmplib.org> | 1999-09-28 17:47:10 +0200 |
commit | cea59e059c9772a6eaaeebb98b3c102c46108310 (patch) | |
tree | 9cab40716e9b5a629d6895d95464faf8d14d1ec5 /gmp.h | |
parent | 348a22d6cceac9b9d1a0a37cbe284bfe1adb6553 (diff) | |
download | gmp-cea59e059c9772a6eaaeebb98b3c102c46108310.tar.gz |
(mpn_incr_u): New macro (from mpn/generic/mul_n.c).
(mpn_decr_u): New macro.
Diffstat (limited to 'gmp.h')
-rw-r--r-- | gmp.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -713,6 +713,24 @@ mp_limb_t mpn_submul_1 _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)); } #endif +#define mpn_incr_u(p,incr) \ + do { mp_limb_t __x; mp_ptr __p = p; \ + __x = *__p + incr; \ + *__p = __x; \ + if (__x < incr) \ + while (++(*(++__p)) == 0) \ + ; \ + } while (0) + +#define mpn_decr_u(p,incr) \ + do { mp_limb_t __x; mp_ptr __p = p; \ + __x = *__p; \ + *__p = __x - incr; \ + if (__x < incr) \ + while ((*(++__p))-- == 0) \ + ; \ + } while (0) + #if defined (__GNUC__) || defined (_FORCE_INLINES) _EXTERN_INLINE mp_limb_t #if defined (__STDC__) || defined (__cplusplus) |