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

Bug#237373: libc6-dev: support for fegetprec / fesetprec to control the dynamic precision modes



On 2004-03-12 15:49:08 +0900, GOTO Masanori wrote:
> Could you provide me more information?
> 
>  - Which merit should we use them?

It is sometimes absolutely necessary to have double-precision
rounding: some algorithms (e.g. to compute with higher precision)
need that, ditto for some standards (Java, XPath). One of the goals
of the IEEE-754 standard is to get reproducible results on various
architectures; so it would be more sensible to have double-precision
rounding in most cases (in fact, I've been told that this was the
case under MS Windows, but I didn't check). Extended precision was
created to allow to implement standard math functions (exp, log,
sin, cos, and so on) easily, by using the arithmetic operations.

>  - n752.htm has only above explanation.  Where can I get more info?

Concerning the specification, isn't this sufficient? Concerning the
implementation, I suppose that this would merely be a wrapper around
fpu_control.h macros. I probably can write that if you want.

Fred Tydeman has also written a file fenvx87.h you can download from
his FTP site <ftp://jump.net/pub/tybor/>, as an example.

>  - Do x86 processors have this kind of functions?

These processors have such control of the dynamic precision modes.

>  - Why was this dropped?

According to Fred Tydeman: "I believe because it only makes sense on
those machines with dynamic rounding precision (which is not mandated
by IEEE-754) and there are many machines with static precision."

However, you should note that:

  * This wouldn't hurt on machines with static precision. In practice,
    the goal would be to change the precision to the double precision
    in every case (nothing to do on machines with static precision).

  * There are also machines with static rounding modes (e.g. ARM
    processors, at least early ones -- those with a floating-point
    coprocessor; and possibly future processors, depending on the
    revision of the IEEE-754 standard); but the functions/macros
    to set/get the dynamic rounding mode haven't been dropped.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA



Reply to: