[PATCH v2] Add i386 and x86_64 fenv support from Cygwin.

Joel Sherrill joel@rtems.org
Sat Sep 7 12:05:00 GMT 2019


On Fri, Sep 6, 2019, 11:58 PM Brian Inglis <Brian.Inglis@systematicsw.ab.ca>
wrote:

> On 2019-09-03 10:02, joel@rtems.org wrote:
> > From: Joel Sherrill <joel@rtems.org>
>
> >  newlib/libc/machine/i386/sys/fenv.h    |   1 +
> >  newlib/libc/machine/x86_64/sys/fenv.h  | 170 ++++++++++++
>
> >  create mode 120000 newlib/libc/machine/i386/sys/fenv.h
> >  create mode 100644 newlib/libc/machine/x86_64/sys/fenv.h
>
> > --- /dev/null
> > +++ b/newlib/libc/machine/x86_64/sys/fenv.h
>
> > +/* Primary sources:
> > +
> > +     The Open Group Base Specifications Issue 6:
> > +   http://www.opengroup.org/onlinepubs/000095399/basedefs/fenv.h.html
> > +
> > +     C99 Language spec (draft n1256):
> > +   <url unknown>
>       http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf (2007)
> > +
> > +     Intel(R) 64 and IA-32 Architectures Software Developer's Manuals:
> > +   http://www.intel.com/products/processor/manuals/
> > +
> > +     GNU C library manual pages:
> > +
> http://www.gnu.org/software/libc/manual/html_node/Control-Functions.html
> > +   http://www.gnu.org/software/libc/manual/html_node/Rounding.html
> > +   http://www.gnu.org/software/libc/manual/html_node/FP-Exceptions.html
> > +
> http://www.gnu.org/software/libc/manual/html_node/Status-bit-operations.html
> > +
> > +     Linux online man page(s):
> > +   http://linux.die.net/man/3/fegetexcept
> > +
> > +    The documentation quotes these sources for reference.  All
> definitions and
> > +   code have been developed solely based on the information from these
> specs.
> > +
> > +*/
>
> Shouldn't this header info also appear in i386/sys/fenv.h?
>

It does via symlink. All of the files should be shared.

>
> Draft standards are mentioned in the catalogue:
>
>         http://www.open-std.org/jtc1/sc22/wg14/www/wg14_document_log.htm
>
> but you have to check PDFs are unlocked - some recent drafts are locked.
>
> Not sure why you mention C99, newer standards are available:
> C2011   http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
>  (2011)
> C2017
>
> https://web.archive.org/web/20181230041359if_/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
>                 (2017)
> C202X   http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2385.pdf
>  (2019)
>

While I agree it is good to use the latest references, I didn't write this
code. I migrated it from winsup/cygwin to newlib so other environments
could use it.

IMO it would be better to migrate it and then tidy up the references. Some
shouldn't be in a machine .h in the new organization. The POSIX and C99
should be in include/fenv.h.

>
>
>
>
> --
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
>
> This email may be disturbing to some readers as it contains
> too much technical detail. Reader discretion is advised.
>



More information about the Newlib mailing list