Cancellation with hgcd / unbalanced mulmod_bnm1

2011-11-11 Thread Niels Möller
mod (B^n - 1)) // mpn_mulmod_bnm1, n x n Will that be better or worse than an unbalanced 3n x n mpn_mulmod_bnm1? In the fft range, it *should* be worse, since the mpn_mul will be done as an mpn_mulmod_bnm1 of size 3n. But what about smaller sizes? Any other tricks? Regards, /Niels -- Niels

Re: Cancellation with hgcd / unbalanced mulmod_bnm1

2011-11-12 Thread Niels Möller
and 2n x n, though That's also related to Torbjörn's suggestion of reusing the transform of the smaller operand. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: Cancellation with hgcd / unbalanced mulmod_bnm1

2011-11-12 Thread Niels Möller
, but then one can't use that value in interpolation for the lower limbs. So it may be a bit tricky. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp

Re: HGCD_REDUCE_THRESHOLD

2011-11-12 Thread Niels Möller
, it would be nice if tuneup -t also showed the total running time for each (or most) tuned threshold. /nisse PS. Thanks for adding the new thresholds on the web page, even before I got around to asking you for it. ;-) -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email

Support for w*ndows

2011-11-25 Thread Niels Möller
to test and maintain portability to w*ndows. I haven't tried doing the same for gmp, but if anybody is interested in doing work to get windows builds of gmp more well tested, I'd recommend that something similar is setup. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid

Re: Double factorial and primorial

2011-12-19 Thread Niels Möller
, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

Re: Double factorial and primorial

2011-12-21 Thread Niels Möller
in the interval. Could perhaps also return the number of primes in the interval, and allow a NULL callback. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp

Re: toom54

2012-02-13 Thread Niels Möller
me that I should correct the toom63 row in the diagram in mul.c. /nisse -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org

Re: Status update: mini-gmp

2012-02-16 Thread Niels Möller
xmalloc as an alias for gmp_default_xalloc, an internal function in mini-gmp.c, rather than including yet another copy of the same thing. I think that's a sensible thing to do, but that change wasn't actually included in the posted patch. Regards, /Niels -- Niels Möller. PGP-encrypted

mini-gmp checkin?

2012-02-17 Thread Niels Möller
this in. Ok? regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

Re: _mp_alloc vs ALLOC

2012-02-22 Thread Niels Möller
or not that's worth the clutter, I'm not sure. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http

Re: Sandybridge addmul_N challenge

2012-02-23 Thread Niels Möller
-- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

Re: Division call in mpn_gcd

2012-02-24 Thread Niels Möller
bits too large, so any final adjustment step can be omitted. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org

Re: Problem with the mp_set_memory_functions interface

2012-02-27 Thread Niels Möller
Any thoughts on this problem with the custom memory allocation functions? ni...@lysator.liu.se (Niels Möller) writes: I find this part of the interface, : The REALLOCATE_FUNCTION parameter OLD_SIZE and the FREE_FUNCTION : parameter SIZE are passed for convenience, but of course they can

Re: New failures related to recent developments

2012-02-28 Thread Niels Möller
mpz_t b) else if (asize 0) return mpn_cmp (a-_mp_d, b-_mp_d, asize); else if (asize 0) -return -mpn_cmp (a-_mp_d, b-_mp_d, asize); +return -mpn_cmp (a-_mp_d, b-_mp_d, -asize); else return 0; } Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid

Re: New failures related to recent developments

2012-02-28 Thread Niels Möller
goes wrong. /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

Re: New failures related to recent developments

2012-02-28 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: After MPZ_REALLOC, all cached pointers must be considered to be defunct. It seems I was only paying attention to the destination pointer. I'll go through all uses of MPZ_REALLOC. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred

Re: test if an unsigned long fits in a limb.

2012-03-07 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: ni...@lysator.liu.se (Niels Möller) writes: One can have alternative functions accepting mp_limb_t and mp_limb_signed_t, if one finds that useful. That would be nice, and so would functions accepting long long. But unfortunatly, neither

Re: test if an unsigned long fits in a limb.

2012-03-07 Thread Niels Möller
, the most urgent problem is to be able to convert between mpz_t and native (64-bit) integers on W64. Is there any other supported platform that has chosen an ABI where Long is smaller than the native word size? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet

Re: Improved gcd_1 code

2012-03-13 Thread Niels Möller
. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

Re: Improved gcd_1 code

2012-03-13 Thread Niels Möller
popcount (of (x-1) ~x). a count_trailing_zeros_gcd should be added which is to be optimised for small counts. Makes sense. I wonder if that should loop, or return MIN(SOME_LIMIT, correct ctz) leaving to the caller to loop. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid

Re: Improved gcd_1 code

2012-03-13 Thread Niels Möller
inputs to the calling function? Maybe gcd is not so special? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org

ABS_CAST

2012-03-27 Thread Niels Möller
. Then negate, cast the resulting *non-negative* number to unsigned, and then an unsigned add of 1 to get the correct absolute value. Am I misunderstanding anything here? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale

Re: Unused code

2012-04-13 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: Are you aware if any more files or functions that are unused? I suspect quite a lot of the new (since a couple of years now...) division code is not used by any advertised mpn_function. Regards, /Niels -- Niels Möller. PGP-encrypted email

Re: _mp_alloc vs ALLOC

2012-05-31 Thread Niels Möller
list is protected by a mutex. (Speaking of allocation, I also wonder what to do about the problem described in http://gmplib.org/list-archives/gmp-devel/2012-January/002161.html, there were no replies at the time). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26

Re: _mp_alloc vs ALLOC

2012-06-04 Thread Niels Möller
limb. The challenge is the large number of affected functions. The most practical way to do that, I think, is to start from the bottom up: The various basecase implementations (which is a pretty large group by themselves), then the toom-variants, then fft. Regards, /Niels -- Niels Möller. PGP

Re: _mp_alloc vs ALLOC

2012-06-04 Thread Niels Möller
temporary allocations and the like, and that appears a bit brittle to me (but I'm not sure I'd trust the automatic stack unwinding with C++ exceptions either...). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government

Re: Generalizing Montgomery mod algorithm

2012-06-14 Thread Niels Möller
the current code most when the divisor is small and the dividend is fairly large. I'd like to, but it's unlikely to happen very soon. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: mpn_sizeinbase

2012-06-14 Thread Niels Möller
; } I think it makes sense to keep the function, and to reimplement it like that. Also the documentation for mpn_get_str ought to be revised, and the revised version ought to refer to mpn_sizeinbase as the recommended method for figuring out the space needed. Regards, /Niels -- Niels Möller. PGP

Re: mpn_sizeinbase

2012-06-14 Thread Niels Möller
- mp_bits_per_limb, z); That seems quite awkward to me. I think it would make more sense to document the contents of an mpz_t. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: GMP 5.0.5 build fails with tcc due to x86_64 asm (unknown register...)

2012-06-20 Thread Niels Möller
they are called, and what the purpose is. The old way of using something like --host=none did disable them, if I understood Marco correctly. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: GMP 5.0.5 build fails with tcc due to x86_64 asm (unknown register...)

2012-06-26 Thread Niels Möller
it the user's job to figure out the the right command line flags for the assembler, I would expect it to be fairly easy to do. Not sure if it's worth the effort, though. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale

bdiv vs redc

2012-06-27 Thread Niels Möller
guess it makes sense to always use a full inverse for redc, given that it's used mainly when the modulo is invariant? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: bdiv vs redc

2012-06-29 Thread Niels Möller
. An addmul_1 with size n gives a result (including the carry limb) of up to B^{n+1} - B, or B-1, B-1, ..., B-1, 0. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: bdiv vs redc

2012-07-10 Thread Niels Möller
the changes in smaller pieces? I'd like to work further on this, but it's not my top priority, so I'm only happy if you or Marco get to it before I do. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government

Re: bdiv vs redc

2012-07-16 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: Some other test cases fail, though: t-root, t-perfpow, t-divis, and t-cong. I'm not familiar with this code, I had a quick look at the root code but didn't see any obvious dependency on bdiv. Found it, it's the divisibility check in perfpow

Re: bdiv vs redc

2012-07-17 Thread Niels Möller
differences between odd and even n? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman

Re: long long

2012-07-30 Thread Niels Möller
long long features conditional on some configure test. If a program attempts to use those feature and is compiled with a compiler which doesn't support long long, then it's going to fail anyway, for other reasons than gmp. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid

Re: 2-adic roots (Re: bdiv vs redc)

2012-07-30 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: Correction: Each iteration gets from \ell to 2 \ell-2, and it needs 2 \ell-1 bits of precision for intermediate values. Yet another correction, after more work on the implementation. For numbers x = 1 (mod 8), there are four square roots mod 2^k

Re: 2-adic roots (Re: bdiv vs redc)

2012-07-31 Thread Niels Möller
values from the earlier (mod B^k) powering. The subproblem here is: Compute x^n (mod B^{2k}), taking maximun advantage of a previous computation of x^n (mod B^k). I could well be missing some simpler trick. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet

Re: long long

2012-08-01 Thread Niels Möller
64-bit arithmetic was introduced, long couldn't be extended to 64 bits for fear of breaking too much old code, and thus long long was invented. And now intmax_t is suffering more or less the same process as long... Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26

Re: speed of mpz_odd_p and lazy allocation

2012-08-14 Thread Niels Möller
think needed handling of alloc = 0 could be done in the unlikely branch of MPZ_REALLOC. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel

Re: Code organisation of mini-gmp

2012-09-10 Thread Niels Möller
wrappers calling this function with different arguments. I don't think there's much benefit in putting all of these wrapper functions in separate files. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: wrap-around interface

2012-10-18 Thread Niels Möller
to change if/when the fft code (or general multiplication) is converted to an itch/scratch interface. If we make this interface public, should we advertise itch/scratch, or should we keep that detail internal, and require applications to always pass tp == NULL? Regards, /Niels -- Niels Möller

Re: A perfect power, and then?

2012-10-24 Thread Niels Möller
, sqrt_exact and root_exact, I guess. I posted some new bsqrt and broot code to this list a few months ago). And perfect_power_p could then be implemented efficiently as mpz_perfect_root (NULL, x) 0. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email

Re: A perfect power, and then?

2012-10-25 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: ni...@lysator.liu.se (Niels Möller) writes: My bsqrt uses an iteration converging to a^{-1/2}, and broot uses an iteration converging to a^{1/n - 1}. Both division free. So binv_sqroot (from mpn/generic/perfpow.c and your bsqrt seem

Re: A perfect power, and then?

2012-10-25 Thread Niels Möller
is a factor of the modulo, which makes it a somewhat strange Hensel lift. Regards,, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list

Re: A perfect power, and then?

2012-10-25 Thread Niels Möller
. Not tonight, though. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

Re: A perfect power, and then?

2012-10-26 Thread Niels Möller
or larger. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

Re: A perfect power, and then?

2012-10-26 Thread Niels Möller
, but with less precision and table lookups. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman

Re: A perfect power, and then?

2012-10-27 Thread Niels Möller
. Similar to how it's doen with binvert and binvert_limb. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org

Re: A perfect power, and then?

2012-10-27 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: broot.c:mpn_broot and your mpn_xxx that computes a^{1/n-1}, perhaps call the latter mpn_brootinvm1 I'll start with this one, then. Here's an initial patch, integrating my code from a few months ago. Some TODO items: 0. Support

Re: A perfect power, and then?

2012-10-28 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: 0. Support in speed, for benchmarking. Not checked in yet, but here are some benchmark numbers, comparing to binvert: $ ./speed -s 1-50 -r mpn_binvert mpn_broot.3 mpn_broot.5 mpn_broot.0x overhead 0.8 secs, precision 1 units

Re: A perfect power, and then?

2012-10-28 Thread Niels Möller
. And then we have the peculiarity that if the input is of size b bits, the output is b-1 (since the top bit doesn't affect the square). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: A perfect power, and then?

2012-10-28 Thread Niels Möller
is particularly bad for n == 1...), we need some book-keeping in units of bits. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel

Re: mpz_combit

2012-10-30 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: I've tried rewriting mpz_combit. Two reasons: 1. To reduce overhead int he common case. 2. I just realized that the common case, for both positive and negative numbers, is to complement the corresponding bit of the absolute value. Any comments

Re: broot vs brootinv performancs

2012-11-13 Thread Niels Möller
calls redc_1, redc_2, and redc_n. No. I think it would make sense to merge the new bdiv code first. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: Side-channel silent division

2012-11-14 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: ni...@lysator.liu.se (Niels Möller) writes: If we can arrange for a loop which does a full quotent limb, and applies it using mpn_submul_1 followed by an mpn_add_cnd_n per quotient3B, would that be faster or otherwise preferable to your loop

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Niels Möller
function, so none is simpler than the other. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Niels Möller
-- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Niels Möller
. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Niels Möller
. 20% difference for single-limb operands definitely is disturbing, I don't see what that might come from. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: mpz_combit

2012-12-27 Thread Niels Möller
the old (or new, if that makes more sense) value of the bit, and possibly also have setbit and clrbit return the old value). Maybe it would be good to keep that file in the repo? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject

Re: mpz_combit

2012-12-27 Thread Niels Möller
think version control is a good thing, also for web stuff. The files don't have to live in the main gmp repo, it could be a neighboring repo if that makes more sense. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale

Re: mpz_combit

2012-12-27 Thread Niels Möller
is less safe, but that may be completely wrong. /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org

Re: Generated files in the repo

2012-12-29 Thread Niels Möller
dependency on bison and flex. Agreed. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org

Re: [PATCH] Optimize 32-bit sparc T1 multiply routines.

2013-01-04 Thread Niels Möller
you're explaining now, but it sounds like it could be advantageous to have one operand invariant in the loop. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: [PATCH] Optimize 32-bit sparc T1 multiply routines.

2013-01-04 Thread Niels Möller
time. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel

arm neon

2013-01-12 Thread Niels Möller
(to bad it doesn' support 64-bit inputs, as far as I see). Has anyone played with that? And in general, where can I find info on the timing of arm instructions (for, say, the most common A9 and A15 implementations)? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid

Re: arm neon

2013-01-14 Thread Niels Möller
/DDI0388I_cortex_a9_r4p1_trm.pdf Seems it should be able to do one vmull per cycle. Not sure how to get latency from the given table, but maybe 6 cycles. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: arm neon

2013-01-14 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: ni...@lysator.liu.se (Niels Möller) writes: And for neon instructions, cycle numbers are in http://infocenter.arm.com/help/topic/com.arm.doc.ddi0388i/DDI0388I_cortex_a9_r4p1_trm.pdf Page? In Chapter 3, multiplication instructions listed

Re: arm neon

2013-01-14 Thread Niels Möller
extend the values we add from 32 bits to 64, which I guess isn't for free. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp

Re: arm neon

2013-01-14 Thread Niels Möller
for constructors and the like). That's also not as portable as the current machinery, I'm afraid, but I guess it should be doable in some way or the other with all linkers which support basic C++ features. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email

Re: arm neon

2013-01-14 Thread Niels Möller
, we need an easily maintainable way to support *both* IFUNC and something more portable. Trying to sort that out is the only way this discussion can be productive. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government

Extending the mpn interface

2013-01-27 Thread Niels Möller
to mpn_tabselect). * mpn_add_1_sec and mpn_sub_1_sec. O(n) operations, always propagating carry all the way. I you think some or all of these extensions of the mpn interface make sense, I may be able to spend some time on this. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid

Re: Extending the mpn interface

2013-02-04 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: Here's a sketch (totally untested, not even compiled), supporting the operations I have seen a need for. As usual, good naming is the difficult part ;-) Here's a new iteration, which has actually had some testing. I think I'll be using

Re: Public mpz_ptr and mpz_srcptr

2013-02-04 Thread Niels Möller
by reference. It's adding a PASCAL feature (what was it called? VAR parameters?) to C. I think you really have to understand the consequences of that design choice, to be able to use GMP. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject

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

2013-02-10 Thread Niels Möller
mpz_leq_ui_p(Z,UI) (! mpz_gt_ui_p(Z,UI)) +#define mpz_leq_si_p(Z,SI) (! mpz_gt_si_p(Z,UI)) +#define mpz_geq_ui_p(Z,UI) (! mpz_lt_ui_p(Z,UI)) +#define mpz_geq_si_p(Z,SI) (! mpz_lt_si_p(Z,UI)) ought to use SI rather than UI in half of the definitions... Regards, /Niels -- Niels Möller. PGP-encrypted

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

2013-02-10 Thread Niels Möller
this seriously or not... Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo

Re: arm neon

2013-02-19 Thread Niels Möller
? Not sure if the same trick can be used with the simd features of x86_32 or power (but as far as I'm aware sse in x86_64 lacks a 64x64-128 multiply, and then it's pretty useless for multiplication). /Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email

Re: Annoying mpz_set_str behaviour

2013-02-20 Thread Niels Möller
expect mpz_set_str to have behaviour consistent with strtol, but then this issue is not the only deviation. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: arm neon

2013-02-20 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: With neon, if we put d0: v0, v1 d1: u0, u0 d2: c0, c1 d3: c0', r1 we could do vmull.u32 q3, d0, d1 ; Form products vaddl.u32 q4, d2, d3 ; Add and extend carry inputs vadd.i64q1, q3, q4 I've implemented a neon

Re: arm neon

2013-02-21 Thread Niels Möller
. How do you test you loops? I just used tests/mpn/t-mul. I can't digest your addmul_4 advice right now. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: Extending the mpn interface

2013-02-23 Thread Niels Möller
?) to the manual, but I haven't done that yet. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http

Re: Neon addmul_8

2013-02-26 Thread Niels Möller
wonder where the bottleck might be for the above loop. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http

Re: Neon addmul_8

2013-02-26 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: Maybe later, but for now, A9 is my target platform. But it seems you're right that Neon is almost useless there. I'm attaching the functions I've been testing, in case anyone else would like to play with them. /Niels dnl ARM neon mpn_addmul_4

Re: Neon addmul_8

2013-02-26 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: May I innocently ask if the function have survived the prescribed testing (tests/devel/addmul_N.c and/or tests/devel/try.c)? ;-) They have been subject to addmul_N.c testing. /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26

Re: ARM Neon popcount

2013-02-27 Thread Niels Möller
-terminal. What about vldm? Like vldmup!, {q0,q1,q2,q3} As far as I understand the manual, it supports a larger number of registers. The registers must be consecutive, but that's no problem here. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26

Re: GMP symbol naming (and the history thereof)?

2013-02-28 Thread Niels Möller
on symbols is appropriate, it would be better to use the namespace gmp_* or maybe libgmp_*. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing

Re: Extending the mpn interface

2013-02-28 Thread Niels Möller
a normalize function or macro to the documented interface. I agree it makes sense to let this function do normalization. We might want to have a public MPN_NORMALIZE anyway, but that's a separate issue. And MPN_ROINIT_N can't normalize, of course. Regards, /Niels -- Niels Möller. PGP

Re: GMP symbol naming (and the history thereof)?

2013-02-28 Thread Niels Möller
to break the ABI). And it's going to break some configure scripts, and programs using dlopen to access GMP symbols. These are all transition problems. I'm not aware of any other drawbacks. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject

Register r9 in the ARM ABI

2013-02-28 Thread Niels Möller
local storage), can a use r9 like any other callee-save register or not? The only potential problem case I see is if my function is interupted by a signal, and the signal handler expects the value in register r9 to be valid. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid

Re: GMP symbol naming (and the history thereof)?

2013-03-03 Thread Niels Möller
, that function is at the top of my list when making additional mpn functions public. Not entirely sure how to deal with inline functions, but there are others in gmp-h.in so I should be able to figure that out. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26

Public mpn_add_nc (was Re: GMP symbol naming (and the history thereof)?)

2013-03-03 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: ni...@lysator.liu.se (Niels Möller) writes: Here are some comments on a few that stood out. Thanks! I think I'll reply in one mail per function (-group). I didn't list __gmpn_add_n_sub_n as public since I consider it experimental. It seemed

mpn_cnd_add_n (was: Re: GMP symbol naming (and the history thereof)?)

2013-03-03 Thread Niels Möller
the condition to be the first argument? Will require minor changes to the assembly implementations. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp

mpn_gcdext_n_basecase (was: Re: GMP symbol naming (and the history thereof)?)

2013-03-03 Thread Niels Möller
the gcdext functions need a large gp area also when the caller knows the gcd = 1? I don't think so, but it gives a very ugly failure behaviour. And I think I'm *almost* sure this element is invertible is also an important usecase. Regardss, /Niels -- Niels Möller. PGP-encrypted email is preferred

Re: mpn_cnd_add_n

2013-03-03 Thread Niels Möller
names for registers, while arm needs one or two additional lines changed since the final argument is passed on the stack. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance

Re: Public mpn_add_nc

2013-03-03 Thread Niels Möller
ns32k/add_n.s pyr/add_n.s z8000/add_n.s clipper/add_n.s I imagine not all these platforms are tested regularly... Something similar could be done with addmul_1/addmul_1c, but let us take one step at a time. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26

Re: _basecase or _sec? [

2013-03-03 Thread Niels Möller
powm_sec and the recent div_sec routines. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org

Re: Public mpn_add_nc

2013-03-03 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: ni...@lysator.liu.se (Niels Möller) writes: As I understand it, that plan would imply that for assembly files currently providing both _n and _nc, the _n entry point gets obsolete That was not the idea, at least not for internal calls

  1   2   3   4   5   6   7   8   >