This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] Add default implementation of fenv.h and all methods


> From: newlib-owner@sourceware.org <newlib-owner@sourceware.org> on behalf of Joel Sherrill <joel@rtems.org>
> Sent: Wednesday, July 31, 2019 7:13 PM
> To: newlib@sourceware.org
> Cc: Joel Sherrill
> Subject: [PATCH 2/3] Add default implementation of fenv.h and all methods
>
>         The default implementation of the fenv.h methods return
>         -EOPNOTSUPP.
>
>         The intention of the new fenv.h is that it be portable
>         and that architectures provide their own implementation
>         of sys/fenv.h.
> ...

The RISC-V-specific things would probably be best removed from libc/include/sys/fenv.h, leaving the original one in machine (unlike the primary fenv.h, which will no longer need to be under machine, as you noted.)  At a glance, using shorthand:
-#define FE_TONEAREST_MM 0x00000004
-#define FE_RMODE_MASK   0x7
(Put another way, it should only have the bare-bones items defined in C and POSIX.)
 
In general:
+  return -EOPNOTSUPP;
     ENOTSUP, not EOPNOTSUPP.  (The latter appears first, so I'm guessing you searched on NOTSUP and just copied the wrong one).

I'd suggest comments in the .c files to say they are non-functional placeholders, even though that should be obvious.
 
While the fenv/Makefile stuff does set up the chewout files, there is no man page stuff in the C files to get.

libm/Makefile.am I think also needs:
-libm.dvi: targetdep.tex math/stmp-def complex/stmp-def
+libm.dvi: targetdep.tex math/stmp-def complex/stmp-def fenv/stmp-def
+fenv/stmp-def: stmp-targetdep ; @true
(It is set up poorly for maintenance, as ideally you'd want these to be automatic from the SUBDIRS line.)

Craig

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]