tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

floating-point exception support



Greetings everyone,

Here[1] is a patch that adds support of fenv.h interface for x86 and
amd64 architectures. It would be great if you could apply the patch
set, rebuild, install and run the test suite, with:

~% git clone git://gitweb.dragonflybsd.org/~beket/mathlib.git
~% cd mathlib/fenv
~% gmake all
~% gmake run

If you have tests of your own, please share. I will add them to the
existing ones and credit will be given where due. If you have some
program (CAS?) that had been failing due to missing fenv bits, try to
build it and report back.

Also, if you happen to have a machine without SSE capabilities (486 ?
Pentium 1 pre-MMX?), it would be very useful as that code path has
never been tested.

There are stuff that can be improved, such as moving the assembly
macros to $arch/cpufunc.S and removing some duplicates. But I wanted
first to make it work and then make it look nice. Also, if this code
eventually enters source tree, it doesn't mean that we advertise that
our libm supports proper float-point exception generation and
propagation. It doesn't and we don't claim it does, since we don't
define MATH_ERRNO nor MATH_ERREXCEPT. So we are safe.

Best regards,
Stathis

[1] http://leaf.dragonflybsd.org/~beket/netbsd/fenv.diff
Note: Patch has been rebased up to 5.99.36. Let me know if it breaks
for more recent versions.


Home | Main Index | Thread Index | Old Index