Re: make check test failures on (MacOS 14.5, M3 pro, Xcode 15.3)

2024-05-28 Thread Niels Möller
elease, 6.3.0. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: Reduced number of allocated limbs after calling mpz_remove

2024-05-21 Thread Niels Möller
that size. To the GMP application, the allocation size of an mpz_t is then bounded by the largest "expected size" for any operation ever using that mpz_t as output (+ effects of any mpz_swap or mpz_realloc2 in the *application* code), which should be sufficient to get predictable memory u

Re: Reduced number of allocated limbs after calling mpz_remove

2024-05-20 Thread Niels Möller
lications can either just #include mini-gmp.c (but then, beware that it defines several macros and functions outside of the advertised interface), and if needed -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. __

Re: Reduced number of allocated limbs after calling mpz_remove

2024-05-20 Thread Niels Möller
ocstring for `mpz_remove`), or fixing this in `mpz_remove`. I don't have a strong opinion on how to fix this discrepancy between docs and implementation. But I feel rather strongly that mini-gmp shpuldn't make this promise, so code that rely on it will not work with mini-gmp. Regar

Re: Reduced number of allocated limbs after calling mpz_remove

2024-05-20 Thread Niels Möller
ot; rather than "never"). Do you think the "never reduce their allocated space" property is important for your usecase, or for other GMP applications general? If the strong statement is kept, this should perhaps be mention as another execption in mini-gmp

Re: GMP repository: "make" failure if yacc is not available

2024-05-15 Thread Niels Möller
as needed by "README.HG", > in case this is specific to the use of the hg repository. You're right that bison should be listed in README.HG. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale g

Re: mini-gmp mpz_gcdext Bézout coefficients do not match documentation

2024-02-18 Thread Niels Möller
nd ChangeLog changes since the previous version of the patch. Thanks for the review, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bug

Re: mini-gmp mpz_gcdext Bézout coefficients do not match documentation

2024-02-18 Thread Niels Möller
1. */ - if (mpz_cmpabs_ui (s, 1) > 0) + /* Require that 2 |s| < |b/g|, or s == sgn(a) */ + if (mpz_cmp_si (s, mpz_sgn (a)) != 0) { mpz_mul_2exp (temp3, s, 1); if (mpz_cmpabs (temp3, temp2) >= 0) @@ -456,8 +460,8 @@ if (mpz_sgn (temp3) != 0) return 0; - /

Re: mini-gmp mpz_gcdext Bézout coefficients do not match documentation

2024-02-17 Thread Niels Möller
s1) > 0 || mpz_cmpabs (t0, t1) > 0) { mpz_swap (s0, s1); mpz_swap (t0, t1); } } And I think this is the only condition that isn't fully symmetrical, so perhaps not surprising if it needs a special case. Regards, /Niels

Re: mini-gmp mpz_gcdext Bézout coefficients do not match documentation

2024-02-17 Thread Niels Möller
confusing), then we ncessarily have |t| != |t'|, and we must choose candidate to get the smaller one. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___

Re: mini-gmp mpz_gcdext Bézout coefficients do not match documentation

2024-02-17 Thread Niels Möller
Niels Möller writes: > Guido Vranken writes: > >> Computing extended gcd using mpz_gcdext where a = 1, b = 2: >> >> libgmp: g: 1, s: 1, t: 0 >> mini-gmp: g: 1, s: -1, t: 1 >> This violates the docs: "s = sgn(a) if abs(b) = 2", e.g. s must be 1 >&

Re: mini-gmp mpz_gcdext Bézout coefficients do not match documentation

2024-02-17 Thread Niels Möller
e inequalities as you suggest, 1 = gcd(1,1) would still be an exception (since in that case, we'd get |s|, |t| < 1/2, i.e., s = t = 0, which isn't reasonable). Can you suggest any doc change to make it clearer? Regards, /Niels -- Niels Möller. PGP key CB49

Re: errors in make check

2024-01-21 Thread Niels Möller
ctures, and not enabled in your build. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listin

Re: parameter size mismatch in mpn_pi1_bdiv_q_1

2023-12-15 Thread Niels Möller
ASM_START() PROLOGUE(mpn_bdiv_q_1) @@ -87,7 +87,7 @@ PROLOGUE(mpn_pi1_bdiv_q_1) L(unorm): lsr x12, x9, cnt cbz n, L(eu1) - sub tnc, xzr, cnt + sub tnc, wzr, cnt L(tpu): ldr x9, [up],#8 lsl x7, x9, tnc -- Niels Möller. PGP key C

Re: `checking size of mp_limb_t... 0` and `configure: error: Oops, mp_limb_t doesn't seem to work` when compiling the Microchip XC32 compiler from source

2023-11-07 Thread Niels Möller
onfigure tests, but defined by configure based on case $limb_chosen in longlong) DEFN_LONG_LONG_LIMB="#define _LONG_LONG_LIMB 1";; *)DEFN_LONG_LONG_LIMB="/* #undef _LONG_LONG_LIMB */" ;; esac AC_SUBST(DEFN_LONG_LONG_LIMB) So not clear to me if/how GMP_LIMB_B

Re: `checking size of mp_limb_t... 0` and `configure: error: Oops, mp_limb_t doesn't seem to work` when compiling the Microchip XC32 compiler from source

2023-11-07 Thread Niels Möller
t turns it into a valid gmp.h header file. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: `checking size of mp_limb_t... 0` and `configure: error: Oops, mp_limb_t doesn't seem to work` when compiling the Microchip XC32 compiler from source

2023-11-06 Thread Niels Möller
relevant include directories. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: `checking size of mp_limb_t... 0` and `configure: error: Oops, mp_limb_t doesn't seem to work` when compiling the Microchip XC32 compiler from source

2023-11-03 Thread Niels Möller
When debugging configure issues, the first step is to check config.log. That should tell you in detail what configure tried to compile or run, and how it failed. Regards, /Niels "Gabriel Staples, ElectricRCAircraftGuy.com" skrev: (3 november 2023 08:26:03 CET) >I could really use some help

Re: Unsigned integer overflow in `toom_eval_pm2.c`

2023-09-04 Thread Niels Möller
leave as is. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: Unsigned integer overflow in `toom_eval_pm2.c`

2023-09-04 Thread Niels Möller
d by Vincent. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: Unsigned integer overflow in `toom_eval_pm2.c`

2023-09-03 Thread Niels Möller
`0` if the `k` is odd (i.e., it either flips all the bits > in the even case or leaves them in the odd case)? I think intention is to conditionally flip all the bits. And in addition, neg should always be either all ones or all zeros. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8B

Re: Side-channel leakage in the mpz_powm_sec interface

2023-08-25 Thread Niels Möller
Hubert Kario writes: > On Friday, 25 August 2023 07:51:10 CEST, Niels Möller wrote: >> And that's for all inputs? Nice. > Well, not all, I mostly tested ones that had obvious patterns, like > zero to power zero, 0xff to power 0xff, full word to power of 1, full > word to power

Re: Side-channel leakage in the mpz_powm_sec interface

2023-08-25 Thread Niels Möller
wer in a circuit, seem too dependent both on hardware details and on the kind of access the attacker can gain to the system. And rather difficult to devise general and portable countermeasures. That said, if GMP can provide advice and/or tools to do it, that's nice of course. Regards, /Niels -- Niels Mölle

Re: Side-channel leakage in the mpz_powm_sec interface

2023-08-25 Thread Niels Möller
owm_sec, and recommending mpn_sec_powm for applications that need side-channel silence. > A possible implementation of your 2-3 points (I didn't look at > documentation) could be the following. Looks rather neat! But I'm still not quite convinced that it is worth doing. Regards, /Niels

Re: Side-channel leakage in the mpz_powm_sec interface

2023-08-25 Thread Niels Möller
Niels Möller writes: > It's preferable to use the mpn_powm_sec. When using mpz_t, I see no > reasonable to avoid leakage of the normalized size (or number of > all-zero limbs at the most significant end). One possibly unreasonable approach for consideration: 1. Document that the mpz

Re: Side-channel leakage in the mpz_powm_sec interface

2023-08-24 Thread Niels Möller
ns, which is a bit confusing. It would be desirable to with a larger rework; it would be better to (i) use byte strings, rather than mpz_t values, for the interface to applications, and (ii) use only mpn-level GMP functions internally. And I would recommend the same approach for any other implementation of R

Re: Possibly an annoying test in configure

2023-08-20 Thread Niels Möller
even fixing all GMP-specific tests would likely not solve your problem (but feel free to try that out, if you believe that would be useful). Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. __

Re: Outdated libtool creates trouble on macOS

2023-07-31 Thread Niels Möller
re --host=x86_64-w64-mingw32 and run tests using wine. On debian, the cross compiler is in the package "gcc-mingw-w64-x86-64-win32". Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale gove

Re: integer overflow in mini-gmp due to integer promotion

2023-07-20 Thread Niels Möller
Vincent Lefevre writes: > No problems when testing MPFR with MINI_GMP_LIMB_TYPE = long, int, > short and char, with -m64 and with -m32. Thanks for testing. I've now committed that change. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet

Re: integer overflow in mini-gmp due to integer promotion

2023-07-19 Thread Niels Möller
Vincent Lefevre writes: > On 2023-07-19 21:24:03 +0200, Niels Möller wrote: >> I think that's needed, to be able to support any size of >> MINI_GMP_LIMB_TYPE. Something like >> >> #define umullo_limb(u, v) \ >> (sizeof(mp_limb_t) >= sizeof(int)

Re: integer overflow in mini-gmp due to integer promotion

2023-07-19 Thread Niels Möller
LIMB_TYPE. Something like #define umullo_limb(u, v) \ (sizeof(mp_limb_t) >= sizeof(int)) ? (u)*(v) : (unsigned int)(u) * (v)) If I understand you correctly, the two multiplies in gmp_udiv_qrnnd_preinv and gmp_udiv_qr_3by2 are the only places where we need a mullo operation, i.e., producing the

Re: Miscompilation on arm64 with GCC LTO

2023-05-10 Thread Niels Möller
O m4 macros). I haven't double checked what assembly files actually look like after preprocessing, though. And something similar for __gmp_binvert_limb_table. But I have no clue about the arm64 abi. Is PIC defined in the failing build, or should it be? Regards, /Niels -- Niels

Re: 6.2.1 Bus error

2023-02-16 Thread Niels Möller
e able to track down, please carefully follow the instructions at https://gmplib.org/manual/Reporting-Bugs. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gm

Re: issue with Microsoft compiler

2023-02-13 Thread Niels Möller
f("y = %ld\n", y); return 0; } -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: issue with Microsoft compiler

2023-02-13 Thread Niels Möller
dd something like -Werror (turn all warnings into compile errors) to the compiler flags get's to deal with the work of suppressing any false positives. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government

Re: bug in __gmp_replacement_vsnprintf

2023-01-09 Thread Niels Möller
880a30d859339cb;hb=HEAD Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: GMP 6.2.1 core2 x86_64 assembler error "operands invalid for `movq'"

2022-11-02 Thread Niels Möller
f them: https://gmplib.org/repo/gmp/file/tip/mpn/x86_64/core2/hamdist.asm#l194 movq %xmm0, %rax For the memory accesses, e.g., movq (up), %xmm1 I agree changing those to movd sounds scary. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet

Re: GMP 6.2.1 core2 x86_64 assembler error "operands invalid for `movq'"

2022-11-02 Thread Niels Möller
movd (i) solves the problem on (older) macos, and (ii) produces identical object code on systems with more up-to-date assemblers. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance.

Re: Reporting a gmp bug

2022-10-26 Thread Niels Möller
s to a merit 14 prime_gap, which is rare. */ odds_in_composite_sieve = 5 * nbits; Thanks for reporting. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. _

Re: mini-gmp mpz_powm incorrect result

2022-09-29 Thread Niels Möller
(mod m) should give? But docs for mpz_*_pow_ui does say that 0^0 yields 1, so for consitency, powm should give 1 mod m, which I think is what the code (with fix) does. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale gover

Re: mini-gmp mpz_powm incorrect result

2022-08-30 Thread Niels Möller
mpz_tdiv_r (r, r, m); >return; > } Should solve the problem, but maybe a bit overkill to call mpz_tdiv_r. Perhaps mpz_set_ui (r, mpz_cmpabs_ui (m, 1) != 0); or even (mn == 0 check just above this code rules out |m| < 1) mpz_set_ui (r, mpz_cmpabs_ui (m, 1)); Regards,

Re: Using WSL2 to cross-compile from Linux to Windows

2022-07-26 Thread Niels Möller
oss_compilation set properly. For some backwards compatiblity reasons one has to explicitly pass --build as well, even when config.guess figures out the build system type perfectly right. Documented in some detail at https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.h

Re: clang warning about mini-gmp.c when used in Emacs

2022-04-19 Thread Niels Möller
figure is almost sure to break. But it could make sense to enable in certain nightly builds with known compilers, if one has the ambition that the code should build without (certain) warnings in that configuration, and stay that way. Regards, /Niels -- Niels Möller. P

Re: clang warning about mini-gmp.c when used in Emacs

2022-04-18 Thread Niels Möller
ni-gmp, I guess one could tweak the check-mini-gmp make target, or the arguments passed to it in nightly builds. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government sur

Re: clang warning about mini-gmp.c when used in Emacs

2022-04-18 Thread Niels Möller
>> +++ b/mini-gmp/mini-gmp.cFri Apr 15 07:20:40 2022 +0200 >> @@ -90,6 +90,7 @@ see https://www.gnu.org/licenses/. */ >> #define gmp_assert_nocarry(x) do { \ >> mp_limb_t __cy = (x); \ >> assert (__cy == 0);\ >> +(void)

Re: Can't install on Kali linux

2022-04-14 Thread Niels Möller
make outputs: make: *** No targets specified and no > makefile found. Stop. If there's no makefile, that sounds like the configure step failed. Check if it produced any errors (and if it did, more details can be found in config.log). Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8

Re: clang warning about mini-gmp.c when used in Emacs

2022-04-14 Thread Niels Möller
patch: --- a/mini-gmp/mini-gmp.c Tue Feb 15 09:18:40 2022 +0100 +++ b/mini-gmp/mini-gmp.c Fri Apr 15 07:20:40 2022 +0200 @@ -90,6 +90,7 @@ see https://www.gnu.org/licenses/. */ #define gmp_assert_nocarry(x) do { \ mp_limb_t __cy = (x); \ a

Re: unused macro MPN_PTR_SWAP in mini-gmp.c

2022-03-19 Thread Niels Möller
g/repo/gmp/file/tip/bootstrap.c#l33. But probably still shouln't define macros not used within mini-gmp.c; any additional utility macros should probably go in mini-gmp.h, and be compatible with public macros from gmp.h. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6

Re: Errors making GMP621 on SCO Openserver 6.

2022-02-03 Thread Niels Möller
environment, maybe it would work better to install, e.g., bash, and set CONFIG_SHELL=/usr/bin/bash (that's a feature I've never had to use)? Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholes

Re: 2 minor issues on Windows

2022-02-02 Thread Niels Möller
est that you disable or ignore that warning. Operations on unsigned types is well defined by the C standard, and gmp depends on practically all possible cornercases to work according to spec. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email i

Re: macOS version detection broken in configure

2021-10-21 Thread Niels Möller
gnulib package? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: 68000 issue in longlong.h

2021-03-05 Thread Niels Möller
pected behavior of gcc. But to me it seems reasonable of gcc to try to share a register when an inline asm template is instantiated with identical expressions for two of the inputs (as in the squaring umul_ppmm(xh, xl, u, u). And the additional & seems to be the documented way to tell it to not do that for this asm template. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: small patch to suppress a warning

2021-02-16 Thread Niels Möller
ing. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: GMP website: old release (3.1.1) cannot be downloaded

2020-12-26 Thread Niels Möller
firefox, no idea if it attempts to use HTTP/2) and clicking those links works for me. Maybe some temporary error? If problem persists, you'd need to share more details on what tools you use to download. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet e

Re: GMP Problem with % under C++

2020-11-05 Thread Niels Möller
ty, so that (f(1) - b) / DECKSIZE == -1. So your problem really is with % in C++, GMP just follows the conventions for the builtin integers. I'm not even sure if rounding is specified by the C++ standards, but rounding towards zero is what all C and C++ implementations I'm aware of use. Regards, /Niels

Re: possible miscompilation on macOS Catalina 10.15.6

2020-10-29 Thread Niels Möller
ding in edge cases not exercised by most applications, and it also has a pretty thorough test suite that tends to detect compiler bugs. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___

Re: possible miscompilation on macOS Catalina 10.15.6

2020-10-29 Thread Niels Möller
follow bug reporting instructions in the fine manual. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: Patch: support callback on allocation overflow instead of calling abort()

2020-10-06 Thread Niels Möller
gnum size, and will raise an emacs exception long before hitting GMP's limits, and the emacs process can go on running with no issues. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government sur

Re: Hardcoded value of GMP_LIMB_BITS impedes bi-arch builds

2020-09-30 Thread Niels Möller
orresponding configure.ac setup. Not sure it's worth the effort, since the multilib organization works fine, and works for *all* libraries with arch-dependent headers. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesal

m4_error not working?

2020-09-18 Thread Niels Möller
(foo)' | m4 mpn/asm-defs.m4 - 3 $ echo 'm4_length(foo, bar)' | m4 mpn/asm-defs.m4 - 3 $ echo $? 0 Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance

Re: Upstream patch to remove abort() that occur during memory overflow

2020-09-03 Thread Niels Möller
you provide a bit more context. How do you handle the callback on overflow? If you longjmp out, how do you arrange so that your mpz variables are in a consistent state? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesal

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-17 Thread Niels Möller
which is a different case. sub_ddmmss (rh, rl, ah, 0, bh, bl) should be the same as rh = ah - bh - (bl > 0); rl = -bl; So we have a borrow to propagate except of also bl == 0, and hence some runtime carry logic is needed. Regards, /Niels -- Niels Möller. PGP-encrypted email is pref

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-17 Thread Niels Möller
round code for special-form ECC-related primes. And, which I guess is more relevant in the sub_ddmmss context, it also means that there's little need for separate instructions for adding and subtracting constants. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-17 Thread Niels Möller
t...@gmplib.org (Torbjörn Granlund) writes: > The two - signs ought to be ~, I think. Let me think a buit more about that. If I remember ARM conventions correctly, subtract with carry is defined as {cout, r} = a + ~b + cin Regards, /Niels -- Niels Möller. PGP-encrypted email is prefer

Re: gmp 6.2.0 build failure in 32-bit mode on Linux/mips

2020-06-14 Thread Niels Möller
fine with other packages, and possibly for gmp too *if* configured with --disable-assembly). Don't do that. The relation between C and asm files is a bit intricate, and you have to either leave ABI choice completely to configure, or tell it in the documented way what you want. Regards, /Niels

Re: Constructor taking 64-bit integer missing on (some) Windows C++ compilers

2020-06-08 Thread Niels Möller
pened to "long", long ago? Just like intmax_t, long was supposed to be the platform's largest supported integer type. Maybe we'll see a "long intmax_t" type when 128-bit types become more established ;-) Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368

Re: 6.2.0 build failure on x86_64 Skylake PC

2020-05-25 Thread Niels Möller
/Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: GMP 6.2 error

2020-04-01 Thread Niels Möller
ll how I install more or less everything that I install from sources rather than from binary packages. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. __

Re: Problem by compiling GMP 6.0.2 ....

2020-03-28 Thread Niels Möller
e clean" generally deletes only files that were created by running make. To delete things created by running configure, you need to run "make distclean". And I also highly recommend using a separate build directory for each configuration. Regards, /Niels -- Niels Möller. PG

Re: mpz_gcdext bug in mini-gmp

2020-03-23 Thread Niels Möller
Renaming fields and dropping leading underscores in mini-gmp might make sense. But keeping them the same makes it easier to copy code between gmp and mini-gmp, which also has benefits. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email i

Re: mpz_gcdext bug in mini-gmp

2020-03-22 Thread Niels Möller
imb array as input, use mpz_roinit_n. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: error compiling gmp-6.2.0 on sparc-sun-solaris2.11 - v9os

2020-02-17 Thread Niels Möller
to undersnd the error, but Sun C 5.11 must be a pretty old C++ compiler, right? Maybe it simply doesn't understand current C++? Do you really need the C++ glue to boostrap gmp and gcc? If not, try configuring gmp with --disable-cxx. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid

Re: whitespace and grammar fixes for mini-gmp.c

2020-01-27 Thread Niels Möller
don't think copyright assignment is needed for these fixes). I wasn't aware that emacs uses GMP or mini-gmp, cool! Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government

Re: assertion failure in snprntffuns.c:79 for i686-w64-mingw32

2020-01-09 Thread Niels Möller
failing case. > /* Define to 1 if you have the `vsnprintf' function and it works properly. */ > #define HAVE_VSNPRINTF 1 I guess it's hard for configure to check for proper return value when cross compiling. Regards, /Niels -- Niels Möller. PGP-encrypted e

Re: [SOLVED] Re: setting CPU_TYPE when cross-compiling from Linux to Windows

2020-01-03 Thread Niels Möller
change to delete the suggestion to use TESTS_ENVIRONMENT to run wine. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.

Re: [SOLVED] Re: setting CPU_TYPE when cross-compiling from Linux to Windows

2020-01-03 Thread Niels Möller
fails: > > ``` > make[5]: Entering directory '/home/claude/wintmp/src/gmp/tests' > wine: Bad EXE format for Z:\bin\bash.. It seems that's a bad suggestion these days, thanks for reporting. I'm fairly confident it used to work with some older version of automake, before the current fancier

Re: setting CPU_TYPE when cross-compiling from Linux to Windows

2019-12-29 Thread Niels Möller
gw32-gcc. > Trying a fat build (thanks for the pointer to this method, I think > it's what I really need) also fails, at `make check`: Can't say why this fails. If you have tried different configs in the same build tree, try starting over from make dis

Re: Compiling for ARMv8-A Using GCC 7.2.0 - Assertion error in gen-fac

2019-12-06 Thread Niels Möller
you say */ #define GMP_HLIMB_BIT ((mp_limb_t) 1 << (GMP_LIMB_BITS / 2)) #define GMP_LLIMB_MASK (GMP_HLIMB_BIT - 1) I see no reasonable way that can end up defining GMP_LLIMB_MASK as 1. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Interne

Re: Report: gmp-6.1.2 on MacOS 10.15 using GCC and two Clang

2019-11-08 Thread Niels Möller
o/gmp/rev/0688aef1f7e3. There probably were some mention of the problem on gmp lists at the time, but I can't look for that at the moment. Seems unrelated to the stack alignment issue, though. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email i

Re: bug in gmp_fprintf still in next release?

2019-10-09 Thread Niels Möller
value). Which is smaller than the mpz_t limit. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmpl

Re: bug in gmp_fprintf still in next release?

2019-10-08 Thread Niels Möller
mpz_t limit, though). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: error on mpz_inits and mpz_clears

2019-09-24 Thread Niels Möller
and will tell you which libraries it loads. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.

Re: Latest commit introduces undefined behavior in hgcd2.c

2019-09-18 Thread Niels Möller
t...@gmplib.org (Torbjörn Granlund) writes: > Or simply: > > dh = (dh << dcnt) + (dl >> (GMP_LIMB_BITS - 1 - dcnt) >> 1); Looks better, thanks. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholes

Re: Latest commit introduces undefined behavior in hgcd2.c

2019-09-18 Thread Niels Möller
< dcnt) + (-(dcnt > 0) & (dl >> (LIMB_SHIFT_MASK & - dcnt))); I'd expect compilers for common archs will generate the same code. It depends on GMP_LIMB_BITS being a power of 2, though. Vaguely related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157. But unlike rotate, an extra m

Re: Assembly routines break Windows 64-bit SEH

2019-05-02 Thread Niels Möller
o nowhere. I also wonder if any other architectures (ARM?) needs anything similar? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing

Re: gmp-6.1.2 Bug Report (gmp_fprintf(), "implicit declaration of function" warning)

2019-04-21 Thread Niels Möller
#Headers-and-Libraries. : Note however that prototypes for GMP functions with FILE * parameters : are only provided if is included too. > #include > #include These two includes need to be in the opposite order. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368

Re: failure with Clang's memory sanitizer: use-of-uninitialized-value

2019-03-28 Thread Niels Möller
expected, it seems unlikely that ul doesn't hold the proper input value. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bug

Re: configure sometimes misses passing LDFLAGS when testing linker

2019-03-28 Thread Niels Möller
gmp_compile="$CC_FOR_BUILD $LDFLAGS conftest.c -o conftest$i" >if AC_TRY_EVAL(gmp_compile); then > if (./conftest) 2>_FD_CC; then > gmp_cv_prog_exeext_for_build=$i > @@ -3966,7 +3966,7 @@ main (int argc, char **argv) >return 0; > } >

Re: not really a bug .. is there a way to set the host type in the Makefile.am ?

2019-02-18 Thread Niels Möller
igure out how the gcc scripts set the gmp host type. Is gmp's config.* involved in any way? If all else fails, you could try hacking the configure script in the gmp tree, to hard code all host-related variables and ignore whatever is passed in from outside. Regards, /Niels -- Niels Möller. PGP-encrypt

Re: compilation fails with CompCert-3.4 on Linux x86-64; patch proposed

2019-01-25 Thread Niels Möller
claring alloca, is that expecting that a replacement alloca.c is used as a fallback? As far as I see, we don't do that in gmp. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. _

Re: Asserts considered harmful (or GMP spills its sensitive information)

2019-01-06 Thread Niels Möller
le/commit/73d3c6d5586cc0fd81eab081078144d621de07b4 Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.or

Re: mini-gmp: error: no previous prototype for 'mpz_lucas_mod'

2019-01-01 Thread Niels Möller
"Marco Bodrato" writes: > The wrapper you propose is more elegant than the workaround I used. > I removed the _TESTING definition and pushed it: > > https://gmplib.org/repo/gmp/rev/14649658a790 Thanks! Regards, /Niels -- Niels Möller. PGP-encrypted email is pre

Re: Asserts considered harmful (or GMP spills its sensitive information)

2019-01-01 Thread Niels Möller
as a way to check that POWM_SEC_TABLE is sane. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: Asserts considered harmful (or GMP spills its sensitive information)

2019-01-01 Thread Niels Möller
ing the core dump collection "services" you mention). And as Vincent says, there are many ways to crash due to bugs, without triggering any assertion failure. And you should avoid generating core dumps for those crashes too. Regards, /Niels -- Niels Möller. PGP-encrypted email is pre

Re: [ADMIN] Foul language and swearwords

2019-01-01 Thread Niels Möller
lished https://www.gnu.org/philosophy/kind-communication.html Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmpl

Re: mini-gmp: error: no previous prototype for 'mpz_lucas_mod'

2018-12-31 Thread Niels Möller
to have a check for __MIN_GMP_TESTING in mini-gmp.c, and a prototype in t-lucm.c. A different way to do it is to add a wrapper in testutils.c (which *includes* mini-gmp.c, in order to get access to internals), and a prototype for that wrapper in testutils.h. Then nothing special is needed in mini-gmp.c itself

Re: Likely GMP bug

2018-05-30 Thread Niels Möller
t. But with the first variant, the first shift can be issued in parallel with ctz, reducing the critical path of the gcd loop. We'd need some benchmarking to see if it makes a difference. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email i

Re: Likely GMP bug

2018-05-28 Thread Niels Möller
<-- min (u, v) */ vlimb += (vgtu & t); /* u <-- |u - v| */ ulimb = (t ^ vgtu) - vgtu; count_trailing_zeros (c, t); ASSERT (c + 1 < GMP_LIMB_BITS); ulimb >>= (c + 1); } vlimb = (vlimb << 1) | 1; return vlimb << zero_bits

Re: Likely GMP bug

2018-05-28 Thread Niels Möller
goto has its uses, but this case with multiple target labels is more like the infamous COME FROM... https://en.wikipedia.org/wiki/COMEFROM Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale gover

Re: Likely GMP bug

2018-05-26 Thread Niels Möller
"Marco Bodrato" <bodr...@mail.dm.unipi.it> writes: > Il Ven, 25 Maggio 2018 2:10 pm, Niels Möller ha scritto: >> That fails with undefined behavior if by chance t == 2^31, so that c == >> 31. >> >> I don't see how that can happen, though, since ulimb,

  1   2   >