[PATCH 2/2] libm: Set math_errhandling to match library and hardware

Corinna Vinschen vinschen@redhat.com
Tue Aug 4 08:57:21 GMT 2020


On Aug  3 10:55, Keith Packard via Newlib wrote:
> math_errhandling is specified to contain two bits of information:
> 
>  1. MATH_ERRNO     -- Set when the library sets errno
>  2. MATH_ERREXCEPT -- Set when math operations report exceptions
> 
> MATH_ERRNO should match whether the original math code is compiled in
> _IEEE_LIBM mode and the new math code has WANT_ERRNO == 1.
> 
> MATH_ERREXCEPT should match whether the underlying hardware has
> exception support. This patch adds configurations of this value for
> RISC-V, ARM, Aarch64, x86 and x86_64 when using HW float.
> 
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
>  newlib/libc/include/machine/ieeefp.h | 11 +++++++++++
>  newlib/libc/include/math.h           | 12 +++++++++++-
>  2 files changed, 22 insertions(+), 1 deletion(-)

Prior to this patch, math_errhandling on Cygwin was set to MATH_ERRNO.
With this patch, math_errhandling on Cygwin is set to MATH_ERREXCEPT.

That may break backward compatibility.  From your patch I take it
that not setting MATH_ERREXCEPT before was just missing, but actually
changing the MATH_ERRNO bit looks wrong to me.

Does that mean Cygwin just has to define _IEEE_LIBM somehwere?  I don't
see that any target is setting _IEEE_LIBM anywhere...


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat



More information about the Newlib mailing list