Re: incorrectly rounded square root
Joel Sherrill <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <CAF9ehCUPhf41dt4wCRhEfWLjBfrKYLdEHYqJdhYfCUVrYKqh1w@mail.gmail.com> |
On Wed, Jun 2, 2021, 2:08 PM Marco Atzeri <[email protected]> wrote: > On 02.06.2021 20:43, Jeff Johnston wrote: > > On Wed, Jun 2, 2021 at 9:08 AM Joel Sherrill <[email protected]> wrote: > > > >> > >> > >> On Wed, Jun 2, 2021 at 2:51 AM Paul Zimmermann < > [email protected]> > >> wrote: > >> > > >> > > I'll second Joel's comment. The code is extremely close to the glibc > code > > both in sqrtf and fesetround. The only > > thing I can think of is that the glibc code does the x87 stuff first and > > does the set back into FPU state before doing the > > SSE stuff. The newlib code sets back the FPU state at the end after the > > SSE stuff. Don't know if this is relevant or not. > > > > Any Cygwin users out there who can verify that the code is working/not > > working for them? > > > > -- Jeff J. > > > > current Cygwin produces for both i686 and X86_64 > > $ gcc -DNEWLIB -fno-builtin test_sqrt.c -lm > > $ ./a.exe > RNDN: 0x1.ff83fp+63 > RNDZ: 0x1.ff83fp+63 > RNDU: 0x1.ff83fp+63 > RNDD: 0x1.ff83fp+63 > Does fegetround() return different values based on what mode was set? --joel > >