Re: RFC: changing precision control setting in initial FPU context

From: Jason Riedy (ejr@CS.Berkeley.EDU)
Date: Sat Mar 03 2001 - 23:21:56 EST


And Kevin Buhr writes:
 -
 - > What Linux does presently on x86 is as right as right can be on
 - > this platform.
 -
 - I'm not so sure.

Let me rephrase: According to a designer of the x87 and one
of the IEEE 754 authors, the behavior currently in Linux and
glibc is reasonable on x86. Reasonable is the best you can
hope for in floating-point.

Double-rounding from intermediate spills isn't reasonable, but
that's neither a kernel nor a C library issue. Tackling that
issue in the compiler is difficult. MS punted and gcc's trying
to get things right (or has, I've lost track, search for `XF',
`mode', and `spill' in the archives). If you want plain single-
or double-precision arithmetic, use a recent IA-32 with SSE2
instructions.

What I should have done in my first response was to refer you to
Doug Priest's supplement to David Goldberg's ``What Every Computer
Scientist Should Know about Floating-Point Arithmetic''. Of course,
you need first read the paper itself. You can find a copy at
  http://www.validgh.com/
Read it with paper, pencil, and calculator handy. You'll want to
work out some examples for yourself. The supplement covers the
issues well.

If you really want to get upset at operating systems, complain
about their lack of support for efficient floating-point exception
handling. ;) (Or search for wmexcp, which will kill that
complaint on x86 Linux.)

Jason
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 07 2001 - 21:00:15 EST