[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [fpu] FPU operations
>
> Hmm, this is interesting, so what should happen if a compare
> instruction
> has a SNAN as an input ? Do we assert the SNAN exception, or do we
> remain
> quiet ?
>
Well isn't what is stored in the FP register file always only NAN?
Anyway Parhmi's book says this:
--
It is somewhat less clear what the results of comparisions such as NAN
!= NAN (true) and NAN <= +INF (false) should be. The general rule is
that NAN is considered unordered ith everything, including itself. Thus
comparisons with NAN produce "invalid operation" exception.
--
Also I am quiting this:
--
Beside the exception signaled when certain comparisons between
unordered values are performed, the ANSI/IEEE stanard also defines
exceptions associated with divide by zero, overflow, underflow, inexact
result, and invalid operation. The first three are obvious. The inexact
exception is signaled when rounded result of operation or conversion is
not exactly representable. The "invalid" exception occurs in the
folloowing situations, among other:
Addition : (+INF) + (-INF)
Mul: 0 x INF
Div: 0/0 or INF/INF
Sqrt: Operand < 0
For more complete description, refer to the IEEE standard.
--
I hope you have information about Guard, Round and Sticky bits. They
are very helpful when doing rounding and detecting properly rounded
result (and generate exception if it isn't). I can quote from the book
if required.
Rudi, did you get answer to your question about comparing with (S)NAN.
>From what I have read it looks comparing to NAN always generates
exception. Right?
--damjan
__________________________________________________
Do You Yahoo!?
Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/