Re: [gmp-bugs] Build feedback for gmp-6.1.0

2016-02-26 Thread Niels Möller
o neon assembly files. To handle the case that we don't want the compiler to emit any neon instructions, but will still want to use neon in assembly files which are used at runtime only if the fat machinery thinks the processor supports it. Regards, /Niels -- Niels Möller. PGP-encrypted

Re: make check show fail 1/58

2016-07-15 Thread Niels Möller
Harley Kooper <5398...@gmail.com> writes: > It was created by GNU MP configure 4.3.2, which was > generated by GNU Autoconf 2.61. Invocation command line was Please try a more recent version than the ancient 4.3.2. Regards, /Niels -- Niels Möller. PGP-encrypted email is pref

Re: Problem with gmp_randinit_set

2017-02-17 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > It shouldn't be too hard to rewrite randseed_mt to use mpn_powm, right? > Which probably didn't exist when the original version was written. Or if we want to take advantage of the structure, we need an mpn function to reduce numbers modulo 2

Re: mpz reuse test takes too much time

2016-09-28 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > and for a five-operand > function like gcdext, I can't easily get the correct count Actually, in the case of gcdext, there are three result arguments, which mustn't overlap with each other. So there are only 16 cases of valid overlap wh

Re: mpz reuse test takes too much time

2016-09-28 Thread Niels Möller
use tests. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: mpz reuse test takes too much time

2016-09-28 Thread Niels Möller
s, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: x86_64-w64-mingw32 test FAIL t-scanf.c:1477: GNU MP assertion failed: ret == (-1)

2017-04-06 Thread Niels Möller
an try to force any windows program linking with gmp to define __USE_MINGW_ANSI_STDIO in each and every compilation unit, so I hope things will work well enough with a mix. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale gove

Re: mpz_powm_ui () for 5.1.2

2017-03-07 Thread Niels Möller
, even on x86_64 (not sure about windows on arm64, though, I haven't bothered to ever try compiling anything for windows phones). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance.

Re: fat_init violates host ABI on Win64

2017-04-25 Thread Niels Möller
-- 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: GNU MP 6.1.2 error undefined symbol __gmpn_invert_limb in test t-constants

2017-08-28 Thread Niels Möller
libraries under test is broken/unsupported, or at least isn't supported with the Solaris runtime linker. (I should probably not speculate more on exactly how it fails, but I'd be happy to hear the precise explanation if someone here really knows the automake magic involved). Regards, /Niels -- Ni

Re: assembly files on Solaris SPARC can only be processed with gcc

2017-08-28 Thread Niels Möller
quot;can only be preprocessed with gcc" sounded like you expected the above incorrect command to somehow succeed in case CC=gcc, and break only if gcc is replaced by Oracles compiler. But it's broken regardless of compiler; the separate m4 step is always required. Do you follow? Regards, /N

Re: assembly files on Solaris SPARC can only be processed with gcc

2017-08-28 Thread Niels Möller
nk it's possible to force gcc to link it statically, but that's discouraged by the gcc people. I haven't tried to really understand the pros and cons. Anyway, gmp uses plain libtool for the shared libraries, so if anything really is fishy with how they are produced, that's most likely

Re: GNU MP 6.1.2 error undefined symbol __gmpn_invert_limb in test t-constants

2017-08-28 Thread Niels Möller
e assembly > files. Right, precisely which internal functions get included in the library depends on both platform and configure arguments. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale go

Re: assembly files on Solaris SPARC can only be processed with gcc

2017-08-29 Thread Niels Möller
then examine and report any errors you get. 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: [PATCH] Inline assembly division needs __volatile__

2017-10-25 Thread Niels Möller
he documented way to tell gcc it shouldn't do that. 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: 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,

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-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
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: documentation on internals not up to date

2018-04-26 Thread Niels Möller
torage. This is the initial state after mpz_init. _mp_alloc == 0 and _mp_size != 0 is a read-only value, _mp_d is neither written, reallocated or freed by mpz functions. It must not be passed as destination argument to any mpz function. Should also link to docs for mpz_roinit_n and MPZ_ROINIT_N.

Re: GMP 6.1.2 t-count_zeros failure on ARM with assertions

2017-12-27 Thread Niels Möller
x) count_trailing_zeros_gcc_ctz(count, >> x) >> -#define COUNT_LEADING_ZEROS_0 64 >> #endif /* __aarch64__ */ >> >> #if defined (__clipper__) && W_TYPE_SIZE == 32 > > I confirm that this fixes the problem. Thanks for testing. Pushed

Re: GMP 6.1.2 t-count_zeros failure on ARM with assertions

2017-12-27 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > Pushed now. And below, a patch to delete all mention of COUNT_LEADING_ZEROS_0, except for tune/many.pl, which I'm not familiar with. What do you think? Regards, /Niels diff -Nprc2 gmp.0e10f8f34eb4/longlong.h gmp/longlong.h *** gmp.0e10f8f34

Re: GMP 6.1.2 t-count_zeros failure on ARM with assertions

2017-12-27 Thread Niels Möller
#ifdef COUNT_LEADING_ZEROS_0, but I found no matches when greping through the sources. I could be missing something, of course. Or maybe it should be used at some places, but currently isn't. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to who

Re: GMP 6.1.2: 32-bit ARM build failure on 64-bit hardware with CFLAGS=-g

2018-01-24 Thread Niels Möller
mp builds. I think GNU standard is to enable -g by default when building with gcc (which has always had reasonable support for generating useful debug info also when optimizing). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale g

Re: ARM Cortex-A7 feature misdetection

2018-02-05 Thread Niels Möller
. Seems less brittle to me than passing the corresponding command line options, in particular for fat builds (i.e., some files with neon assembly, used at runtime only after some check of available instructions), where one might not want the C compiler to emit any neon instructions. Regards, /Niel

Re: Configure fails on 32-bit platform

2018-02-12 Thread Niels Möller
s, and only consider choices of gmp-ABI which are consistent with the user's compiler-ABI. It's a bit unclear to me in which cases there are multiple gmp-ABI consistent with the same compiler-ABI. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is

Re: Configure fails on 32-bit platform

2018-02-12 Thread Niels Möller
., ./configure CC='gcc -m32' CXX='g++ -m32' 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: Configure fails on 32-bit platform

2018-02-12 Thread Niels Möller
to the user. I think it would be better to not automatically add -m64 in this case, but just display a loud message suggesting a reconfigure with CC='gcc -m64'. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government

Re: Configure fails on 32-bit platform

2018-02-11 Thread Niels Möller
. But CFLAGS is *not* interpreted by configure in any way. Please use the documented mechanism to get the configuration you want. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government

Re: GMP 6.1.2 t-count_zeros failure on ARM with assertions

2017-12-26 Thread Niels Möller
zeros_gcc_ctz(count, x) -#define COUNT_LEADING_ZEROS_0 64 #endif /* __aarch64__ */ #if defined (__clipper__) && W_TYPE_SIZE == 32 -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance.

Re: GMP 6.1.2 t-count_zeros failure on ARM with assertions

2018-01-02 Thread Niels Möller
t128_t on compilers that support that). /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/listin

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: 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: 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-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'

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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
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: [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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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
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: 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: 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: 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: 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: 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: 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: 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: 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: 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-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: `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: `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-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: 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: 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-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: 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-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: 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: 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-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: 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: 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,

  1   2   >