Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-16 Thread Paul Zimmermann
Dear Torbjörn, > This bug comes untimely for me. I consider a major purge along the > lines of the patch below. [...] I confirm all MPFR 4.1.0-rc1 tests pass on gcc115 with this patch applied to mpfr-longlong.h, both with GCC 9.1.0 and 10.1.0 (they failed with GCC 9.1.0), where

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-16 Thread Torbjörn Granlund
Vincent Lefevre writes: Note: in the tests, it is important to test the macro on constants in order to test the "if" case. Indeed, and one macro expansion per trivial function or else gcc might get the idea cse constants. This bug comes untimely for me. I consider a major purge along the

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-16 Thread Vincent Lefevre
On 2020-06-16 16:11:53 +0200, Vincent Lefevre wrote: > Note that I'm rather surprised to see that the issue disappears > if I add unrelated code. For instance, in the following testcase, > with GCC 9.1.0 -O2, I get "h = 0x", which is > incorrect, but if I define V, I get the

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-16 Thread Vincent Lefevre
On 2020-06-16 14:47:23 +0200, Torbjorn Granlund wrote: > Vincent Lefevre writes: > > On 2020-06-16 13:40:14 +0200, Torbjorn Granlund wrote: > > Vincent Lefevre writes: > > > > #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ > > do {

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-16 Thread Torbjörn Granlund
Vincent Lefevre writes: On 2020-06-16 13:40:14 +0200, Torbjorn Granlund wrote: > Vincent Lefevre writes: > > #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ > do { \ > if (__builtin_constant_p (bl) &&

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-16 Thread Torbjörn Granlund
Vincent Lefevre writes: #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ do { \ if (__builtin_constant_p (bl) && -(UDItype)(bl) < 0x1000) \ __asm__ ("adds\t%1, %x4, %5\n\tsbc\t%0, %x2, %x3"

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-16 Thread Vincent Lefevre
On 2020-06-16 12:55:07 +0200, Vincent Lefevre wrote: > In longlong.h from GMP 6.2.0: > > #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ > do { \ > if (__builtin_constant_p (bl) && -(UDItype)(bl) < 0x1000) \ >

bug in longlong.h for aarch64 sub_ddmmss

2020-06-16 Thread Vincent Lefevre
Hi, In longlong.h from GMP 6.2.0: #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ do { \ if (__builtin_constant_p (bl) && -(UDItype)(bl) < 0x1000) \ __asm__ ("adds\t%1, %x4, %5\n\tsbc\t%0, %x2, %x3"