i386 and x86_64 fenv support

Joel Sherrill <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CAF9ehCWrHVR3MAojGHEVwLp=44D7F-mE96Frr4fHyzkyPrU8ag@mail.gmail.com>
Hi

Earlier we discussed moving the winsup fenv.h files to newlib. Splitting
winsup/cygwin/include/fenv.h to create a sys/fenv.h looks easy enough.
But I have some status and a question after tinkering with this code out
of tree and compiling with the RTEMS i386 and x86_64

It includes winsup.h and wincap.h but it doesn't need them.

It is a C++ file and changing it to C only resulted in needing to change
bool to int and true/false to 1/0. That should be OK.

There are prototypes for fegetprec() and fesetprec(). I think the
prototypes need to move to the shared fenv.h and commented
stubs for the constants needs to be in the shared dummy sys/fenv.h.
Does this sound right?

My remaining issue is that it appears that i386 and x86_64 will need to
share the same files. Do I just copy the files to both machine directories?
I don't know if newlib's build infrastructure supports putting it in one
place and using it in another architecture.

FWIW this moved up in importance because the x86_64 RTEMS toolchain
won't build with the gcc/newlib master because libquadmath assumes the
existence of the FE_TONEAREST since it the autoconf probe now sees
we have fenv.h support now. This is probably a bug in this code since it
can't assume a rounding mode is supported.

Feedback appreciated.

Thanks.

--joel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.