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

RE: [fpu] FPU operations




> I'm still uncertain if this is really what we want. When you are
> doing
> CMP, you are trying to determine the value. You not necessarily want
> an exception to occur. Think of it as such: You are trying to
> implement
> an complex math function in software. Perhaps an reserved FP
> instruction
> that is not implemented traps (unimplemented instruction) and the
> software
> tries to emulate it. You want to deal with all possible situations in
> your
> code. You try to avoid generating a second level trap, and then
> perhaps
> a third level trap. At some point you will die.
> 
> Does this make sense ? Can you see my point ?
> 

I see your point. But look like this way:

if you want to cover as much as possible in software and try to avoid
exceptions then everything could be very slow if chance to get
exception is very small. It is like with overflow/underflow. You can
either test for OF/UF all the time OR you can leave this to exceptions.
If chance for OF/UF is 0.1% then you should definately leave to
exception routine to handle these 0.1% of cases (for overall
performance it will be much faster).

I think like this: most of the time you do regular arithemtics and you
don't have extreme results (like OF/UF, NANs etc). So it makes sense to
do only regular math and leave checking for these uncommon stuff with
exceptions.

And we can also put a control bit in FP control register that selects
between both options.

--damjan



__________________________________________________
Do You Yahoo!?
Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/