[PATCH 0/2] libm/riscv: Fixing machine-specific fma/sqrt

Keith Packard keithp@keithp.com
Mon Sep 7 22:52:53 GMT 2020


Joseph Myers <joseph@codesourcery.com> writes:

> However, it's probably nontrivial to get the tests running on other
> implementations, since they freely make use of glibc-specific
> features, and the particular glibc choices they test for regarding
> errno, exceptions and expected accuracy of results may not match the
> choices made by other libm implementations.

I agree -- I looked at getting the glibc tests running on newlib and
decided that it would be more effort that I could afford. For now, I've
got the original newlib test suite running after spending several months
fixing it.

In particular, for the math tests, I ran glibc against the test vectors
and replaced the expected results with those as the existing values had
become corrupted over the years (not just inaccurate, but wildly
wrong). Mismatches between newlib and glibc were investigated, and
patches to newlib have been integrated. No patches were needed for
glibc. Now newlib generates results that match glibc within reasonable
tolerance bounds. With the recent patches to fix up exceptions and errno
values, newlib and glibc match there as well. I guess this is kinda like
testing newlib against the glibc test suite at a distance -- glibc gets
tested, then we make sure newlib and glibc generate the same values for
a different set of tests...

I'd love to be able to spend time improving the accuracy of newlib code,
but just having code which constantly measures 'reasonably close' to
glibc is a huge improvement from my perspective.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/newlib/attachments/20200907/db6378d7/attachment.sig>


More information about the Newlib mailing list