[llvm-dev] how to simplify FP ops with an undef operand?

Matt Arsenault via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 2 11:53:48 PST 2018



> On Mar 2, 2018, at 14:45, Kaylor, Andrew <andrew.kaylor at intel.com> wrote:
> 
> Well, using ConstantFP to represent NaNs is at least unclear enough that someone claimed that there is no NaN constant in LLVM IR. :-)
> 
> But your point is well made. I guess what I was really asking for is a 'NaN' token in the asm writer/parser. This is obviously a much less important issue, but I can't say that I would look at 0x7f800000 in an ll file and immediately think, "Oh, that's a NaN." I'm not a fan of hexadecimal representation of floating point numbers in general, but I guess it's a necessary evil for exact conversion back to bitcode. The 'NaN' I'm asking for, of course, has something like 4 million possible representations, but I think they are all equivalent.
> 
> In short, never mind.

One issue I’ve always had is the nonsensical use of double FP constants even for float values. I can recognize the special FP values if they appear in their natural 4-byte format, but when awkwardly converted to double it’s more difficult, especially when I’ve written tests checking for the correct handling of payload bits.

-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180302/9262fde0/attachment.html>


More information about the llvm-dev mailing list