Re: [PATCH] Remove matherr, and SVID and X/Open math library configurations
Corinna Vinschen <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
On Jan 22 17:27, Craig Howland wrote: > On 1/22/19 3:51 PM, Jozef Lawrynowicz wrote: > > ... > > I've attached the original patch (0001-*), but also 3 further patches which > > make some additional improvements to the float math functions. > > > > 0002-Newlib-Remove-HUGE_VAL-definition-from-libm-math-fun.patch > > This patch removes the definitions of HUGE_VAL from some of the float math > > functions. HUGE_VAL is defined in newlib/libc/include/math.h, so it is not > > necessary to have a further definition in the math functions. > > > > 0003-Newlib-Use-HUGE_VALF-instead-of-HUGE_VAL-in-single-p.patch > > This patch replaces instances of "(float).*HUGE_VAL" with a direct usage of > > HUGE_VALF, which is also defined in math.h. > > > > 0004-Newlib-Use-nanf-instead-of-nan-in-single-precision-f.patch > > This patch further reduces code size for a few single-precision float math > > functions, by using nanf() instead of nan() where required. > > > > I've regtested the patches with the GCC testsuite for arm-unknown-eabi, and I > > built Cygwin and regtested it with "make check". > > > > Thanks, > > Jozef > The tgamma() return values don't match the POSIX recommendation. This > is not really the fault of this patch, but the patch is propagating mistakes > in the existing __kernel_standard() function (in k_standard.c). POSIX > defines a domain error for negative integers, with errno=EDOM return NAN. > This case is identified by value 41 to __kernel_standard(), except that it > is also grouped with the case of tgamma(0). tgamma(+-0) is a pole error, > errno=ERANGE return +-HUGE_VAL, with the sign matching the argument. In > addition, an overflow error (value 40 to __kernel_standard()) is supposed to > match the sign. That is, the existing implementation has several mistakes in > it which are being propagated in the revised implementation. Put another > way, there are 3 different error classes, yet __kernel_standard() only has 2 > that are used by tgamma(). > Speaking of the __kernel_standard() function, it really would best be > deleted. It is only called from tgamma() and tgammaf(), and could therefore > stand a very large pruning, at the least. But rather than that, just > getting rid of it seems to be in order because the entire purpose behind > __kernel_standard() appears to be related to the matherr stuff being > deleted, and fixing the aforementioned tgamma() return-value problems would > be more easily done within the functions than expanding __kernel_standard(), > anyway. > These comments are really about existing flaws and not flaws in this > patch, but it does seem a good opportunity to take care of them. Are you going to patch this? Thanks, Corinna -- Corinna Vinschen Cygwin Maintainer Red Hat
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxINWEACgkQ9TYGna5E T6CXfxAAh2/xWssguTyOYFEHdEPhbCWSJc62C9Egc+eB8ihNHJDCuf0sDBNCgl0J /mAapwh+G/L/U7GJ4HcYjiEv7hBD9crBO9GcVa72InhPUMoHzt6/xWtrxbJ+wSn5 gNErURp2fHqNzR/jx0Rf34tpGUt5VMzQgRggJGiiOJPSI0DAKrpqZcle7S8unx1n z7v2ueDlSCPeyUyCQwVrLmlhKHQX7c8Hd4pVANZsgbxE+UQNEgG7Jy/bbASpHVs9 QyNoYeZT5DbGfmJ7JKl9M46EHDx8g0b7Zkd1r95k1H5l8Qn+GyH7A9ZC4RzvpcHE 4HSuD9UFaEHkCqU4G4sicWldQTVv1CpmEF4auUPv5XXU+pTmEwDpRjx0ORHurYnw cl5nzIQWoQ4spBvN3raoWA4m9IV4kckd+4KsXIwfSok3glj6GmYQ+jeOe04WA0mU PjIb/cSI1wkpr4JDuWvGuAv+AkHb0/pzJkv8haLK+0fYY3cPcL0bV5z2nrGmIHBz GRs9MC/D1+APzmoaSv+Ddl2MdpOuCJylsCCGjm9gR3kEKrnNTdS/X+wZ0cY6VhEw wbSe4tJOpaajI5o/qOvDylPTqSWapzrHDv9kDgO2/UrefodGqEB3UGEk5Z+v3h+z UF+BQsuZWMwO55146OK7cgbH4miIq7bkn/UFd8FsanV+XEjSC5U= =qRXG -----END PGP SIGNATURE-----