Bug#237373: libc6-dev: support for fegetprec / fesetprec to control the dynamic precision modes
At Fri, 12 Mar 2004 09:18:41 +0100,
Vincent Lefevre wrote:
> 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.
Thanks for your detailed explanation, I understand this is about
manipulating wrapper function of x87 precious control field. The
similar symbol is already defined in fpu_control.h like _FPU_EXTENDED
and so, on i386/adm64/m68k/sparc.
> > - 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.
I understand this is sometimes useful when a user want to change the
precision of FPU. But, the problem is it's extended function, not
standard. soft-fp in glibc uses EXTENDED, and don't recommend SINGLE.
I found recent Solaris on x86 only defines it. Is this function
future-rock?
Regards,
-- gotom
Reply to: