mpz_{eq,lt,gt}_{ui,si}_p macros?

2013-02-10 Thread bodrato
Ciao! I played with gmpxx.h for a while, because Torbjorn said something about possible functions for comparison with shortcuts to detect specific conditions (, =, or )... After some tests with C++ I moved my experiments to plain C. The current status of the experiments is shown by the attached

Re: mpz_{eq,lt,gt}_{ui,si}_p macros?

2013-02-10 Thread Marc Glisse
On Sun, 10 Feb 2013, Torbjorn Granlund wrote: bodr...@mail.dm.unipi.it writes: If you like the idea, then please read carefully the lt_si and gt_si variants, I'm not sure I'm handling correctly the negative constants. I like the idea. I stopped reading when I found that several

Re: mpz_{eq,lt,gt}_{ui,si}_p macros?

2013-02-10 Thread Niels Möller
bodr...@mail.dm.unipi.it writes: Do you think it can make sense? Makes sense to me. Are there any realistic benchmarks where it makes a difference? Some typos seem to remain, e.g, +#define mpz_neq_ui_p(Z,UI) (! mpz_eq_ui_p(Z,UI)) +#define mpz_neq_si_p(Z,SI) (! mpz_eq_si_p(Z,UI)) +#define

Re: mpz_{eq,lt,gt}_{ui,si}_p macros?

2013-02-10 Thread Niels Möller
bodr...@mail.dm.unipi.it writes: Let's take the gt_ui macro: #define mpz_gt_ui_p(Z,UI) \ (__builtin_constant_p (UI) (UI) == 0 ? (Z)-_mp_size 0 \ : __builtin_constant_p ((UI) = 0 (UI) = GMP_NUMB_MAX) \ ((UI) = 0