[LLVMdev] a question about constant fold for fdiv

Andrew Lenharth andrewl at lenharth.org
Thu Mar 22 16:30:32 PDT 2007


On 3/22/07, Reid Spencer <rspencer at reidspencer.com> wrote:
> On Thu, 2007-03-22 at 15:50 -0700, leo han wrote:
> > Hello, I have a question about the constant folding for fdiv instructions.
> > For the instruction "fdiv double 0.0, 0.0", the folded result is inf. I
> > think this should be nan. Can anyone tell me why it is not nan?
>
> I think the specification says that it is "undefined" so any value will
> do. inf is just as undefined as nan.

I seem to recall that gcc's interpretation of undefined in this
situation is also inf.

Andrew



More information about the llvm-dev mailing list