[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #26 from Andrew Pinski --- (In reply to Andrew Pinski from comment #25) > Note the darwin (mac OS X) aarch64 (arm64) ABI says long double is 64bits. > It would be implemented that way even in GCC for Mac OS X ARM64. > clang/llvm for

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|NEW

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #24 from jacob navia --- Sorry, you are right. This is a terrible mistake FROM MY PART! I am using the raspberry pi through ssh and I had several shells open, using my Macintosh ARM 64 as the machine where I started those shells. B

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #23 from Jakub Jelinek --- > OK, but you are NOT RUNNING IN AN ARM 64 do you? Because that's the machine > I am using... So that would point to glibc's printf then. Try to use %a to see the hex values, those are much more easily ver

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #22 from jacob navia --- (In reply to Jakub Jelinek from comment #20) > All I'm arguing is that everything I see from gcc seems to be correct. > 30 digits precision is not enough for IEEE quad, 36 is enough. > If I try your sqrt (2^2

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #21 from jacob navia --- When I post I come to a page MIDAIR COLLISION DETECTED and that provokes these repeated messages Sorry but there is a bug in the bug reporting software... Gosh! :-)

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #20 from Jakub Jelinek --- All I'm arguing is that everything I see from gcc seems to be correct. 30 digits precision is not enough for IEEE quad, 36 is enough. If I try your sqrt (2^255) case on x86_64, I see: #define _GNU_SOURCE #i

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #19 from jacob navia --- Sorry but the program I used was compiled with gcc. It suffers from lack of precision too. In ANY case, in decimal now, the square root of 2 is 1.414 213 562 373 095 048 801 688 724 209 698 078 GP PARI calcu

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #18 from jacob navia --- I can’t reply you because you do not accept accented characters, just plain ascii, and my mailer uses a French Accentuated character to say « You wrote » and the whole message is translated into mime/html. I

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #17 from jacob navia --- Sorry but the program I used was compiled with gcc. It suffers from lack of precision too. In ANY case, in decimal now, the square root of 2 is 1.414 213 562 373 095 048 801 688 724 209 698 078 GP PARI calcu

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #16 from jacob navia --- Sorry but the program I used was compiled with gcc. It suffers from lack of precision too. In ANY case, in decimal now, the square root of 2 is 1.414 213 562 373 095 048 801 688 724 209 698 078 GP PARI calcu

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #15 from jacob navia --- > Le 24 oct. 2022 à 22:21, jakub at gcc dot gnu.org > a écrit : > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 > > --- Comment #12 from Jakub Jelinek --- > I have to agree with Joseph (on x86_64

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #14 from Jakub Jelinek --- (In reply to jacob navia from comment #7) > mpfr_init2 (m, SIGNIFICAND_BITS); > > How much is that SIGNIFICAND_BITS? I guess that is the problem. 160 for 32-bit hosts, 192 for 64-bit hosts.

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #13 from Jakub Jelinek --- glibc math.h has: # define M_SQRT2f128__f128 (1.414213562373095048801688724209698079) /* sqrt(2) */

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #12 from Jakub Jelinek --- I have to agree with Joseph (on x86_64-linux I get): #define _GNU_SOURCE #include #include int main () { volatile _Float128 x = __builtin_sqrtf128(2.0f128); char buf[256]; strfromf128 (buf, 128, "%

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #11 from jacob navia --- Please let's use 30 digits after the decimal point not 20. Long double gives 32 digits with 128 bits.

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #10 from jacob navia --- Please let's use 30 digits after the decimal point not 20. Long double gives 32 digits with 128 bits.

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #9 from jacob navia --- Actually, this looks that a bug in all versions of gcc! Using the "GP" calculator I obtain: 1.414213562373095048801688724209698078 Using the "bc" calculator ~ % bc bc 1.06 Copyright 1991-1994, 1997, 1998, 200

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread joseph at codesourcery dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #8 from joseph at codesourcery dot com --- On Mon, 24 Oct 2022, jacob at jacob dot remcomp.fr via Gcc-bugs wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 > > --- Comment #3 from jacob navia --- > 1 trunk gcc: > 2

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #7 from jacob navia --- mpfr_init2 (m, SIGNIFICAND_BITS); How much is that SIGNIFICAND_BITS? I guess that is the problem.

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jacob at jacob dot remcomp.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 --- Comment #6 from jacob navia --- mpfr_init2 (m, SIGNIFICAND_BITS); How much is that SIGNIFICAND_BITS? I guess that is the problem.

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #5

[Bug middle-end/107370] long double sqrtl constant folding is wrong

2022-10-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Keywords|