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

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 1 21:33:37 PST 2018


I just posted a long response on the thread, but it is important to know that these LLVM IR instructions are not defined and do not respect rounding mode or IEEE trapping flags.  Only the intrinsics do.

-Chris


> On Mar 1, 2018, at 11:25 AM, Stephen Canon <scanon at apple.com> wrote:
> 
> Wait, back up, what? The invalid flag raised by operations on sNaN is no different from any other flag in fenv. There’s nothing sensible about saying that every operation that raises underflow/overflow/inexact is undefined, why are operations on sNaN any different?
> 
> – Steve
> 
>> On Feb 28, 2018, at 11:41 PM, Chris Lattner via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>> 
>> However, fdiv/fmul/etc are pervasively treated as not having side effects.  The intention, and the only sensible definition for them, is that they are undefined on SNaNs.  
> 

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


More information about the llvm-dev mailing list