jcranmer-intel added a comment.

You definitely don't want these rules to apply to all qNaNs. It's when an input 
operand is an sNaN for many operations. Note that the result of an operation 
with an sNaN as input (and FP result type) is a qNaN output, and the only times 
that you get an sNaN output are the times when you never signal (I think), so 
checking the result type is incorrect.



================
Comment at: clang/lib/AST/Interp/Interp.cpp:534-539
   if ((Status & APFloat::opStatus::opInvalidOp) &&
       FPO.getExceptionMode() != LangOptions::FPE_Ignore) {
     // There is no usefully definable result.
     S.FFDiag(E);
     return false;
   }
----------------
A further note is that sNaNs signal `FE_INVALID` when used, so sNaN should 
generally fall into this if statement in particular.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156506/new/

https://reviews.llvm.org/D156506

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to