At 06:26 AM 6/27/00 -0500, Tomasz Motylewski wrote:
>On Tue, 27 Jun 2000, Bjorn Eriksson wrote:
>
> > > double x = 3.4;
> > > double y = 5.67;
> > > double z = 0.0;
> > > for (long i=1; i<10000; i++) {
> > > z += x+y;
> > > }
> > >
> > > printf("%lf\n",z);
>
> > Rewriting so as to not make the code dependent on how smart the
> optimizer
> > is. Sound advice which I ASsumed the original poster had though of.
> I'd like
>
>Well, I was not concerned about optimizer (but now I am as well).
>I just thought that may be if emulation is done by interrupts, then
>blocking
>them just causes no exceptions - no operations beeing done. Therefore
>I would
>expect z=0.0 on exit when interrupts are blocked. But I was just guessing.
>Tomek
Software floating point emulation is done with exceptions (traps) which
are close cousins to interrupts. Traps work just like interrupts but
are not maskable. The primary differences between a trap and an
interrupt are (a) traps are not maskable and (b) traps come from
executing an instruction while interrupts come from the outside
hardware. If the AMD SC410 has maskable traps, it is seriously broken.
gvb
--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.