[llvm-dev] [754] Fold FP "Op SNaN" to QNaN?

Kevin Neal via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 9 08:41:10 PDT 2021


I'm looking at lib/Analysis/InstructionSimplify.cpp where the function propagateNaN() has a comment asking if it should quiet a signaling NaN.

If I understand the IEEE 754-2019 standard correctly: an SNaN shall be converted to a QNaN whenever an "operation" is done. The standard doesn't say, or I couldn't find it, exactly _when_ that operation must be done. Which implies that the floating-point operation could be done by the compiler. In which case folding an instruction that has an SNaN operand should result in a QNaN.

Is my reading of the standard correct? And should we make this change to InstructionSimplify.cpp:propagateNaN() and perhaps more generally in LLVM?
--
Kevin P. Neal
SAS/C and SAS/C++ Compiler
Compute Services
SAS Institute, Inc.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210709/f36125ff/attachment.html>


More information about the llvm-dev mailing list