Displaying 4 results from an estimated 4 matches for "is_nan".
2015 Feb 05
3
[LLVMdev] Proposal for Poison Semantics
...n one way, the hacked lli is not as good as Alive (it only reasons about
> one execution at a time) but on the other hand it tells us what happens for
> real codes which Alive does not.
Turns out that undef + fast math flags is enough to cause LLVM to become
inconsistent:
define i1 @f(i1 %a.is_nan, float %a, float %b) {
%add = fadd nnan float %a, %b
%sel = select i1 %a.is_nan, float undef, float %add
%cmp = fcmp ord float %b, %sel
ret i1 %cmp
}
When 'b' is NaN, the following occurs:
%add = float undef
%sel = float undef
%cmp = i1 false
However, the 'select i1 %A, %B, un...
2015 Feb 04
2
[LLVMdev] Proposal for Poison Semantics
On Wed, Feb 4, 2015 at 9:13 AM, John Regehr <regehr at cs.utah.edu> wrote:
> I think such a thing would be great. However, there is a problem that the
>> RFC wasn't aware of when it was
>> written:
>>
>> consider:
>> %S = select %A, %B, undef
>>
>> without us knowing anything about %A or %B, we will replace all uses of
>> %S with %B.
2019 Oct 08
2
PR43374 - when should comparing NaN values raise a floating point exception?
* Sanjay Patel via llvm-dev <llvm-dev at lists.llvm.org> [2019-10-01 09:44:54 -0400]:
> Let's change the example to eliminate suspects:
> #include <math.h>
> int is_nan(float x) {
> /*
> The following subclauses provide macros that are quiet (non
> floating-point exception raising)
> versions of the relational operators, and other comparison macros
> that facilitate writing
> efficient code that accounts for NaNs without suf...
2019 Oct 01
5
PR43374 - when should comparing NaN values raise a floating point exception?
Hi,
I’ve been investigating https://bugs.llvm.org/show_bug.cgi?id=43374, which is about clang/llvm producing code that triggers a floating point exception when x is NaN, when targeting ARM, in the below code example.
int bar(float x) {
return x!=x ? 0 : 1;
}
The C99 standard states in section 7.12.14:
"""
The relational and equality operators support the usual mathematical