search for: __isnan

Displaying 10 results from an estimated 10 matches for "__isnan".

2005 Jan 04
2
ISNAN() broken? in ver 2.x on MacOS X
...); which works. R 2.0.x has # define ISNAN(x) (isnan(x)!=0) unconditionally. This breaks because on MacOS X in /usr/include/architecture/ppc/math.h isnan() is itself a macro thus: #define isnan( x ) ( ( sizeof ( x ) == sizeof(double) ) ? \ __isnand ( x ) : \ ( sizeof ( x ) == sizeof( float) ) ? \ __isnanf ( x ) : \ __isnan ( x ) ) This macro is not substituted becaus...
2005 Jan 04
2
ISNAN() broken? in ver 2.x on MacOS X
...); which works. R 2.0.x has # define ISNAN(x) (isnan(x)!=0) unconditionally. This breaks because on MacOS X in /usr/include/architecture/ppc/math.h isnan() is itself a macro thus: #define isnan( x ) ( ( sizeof ( x ) == sizeof(double) ) ? \ __isnand ( x ) : \ ( sizeof ( x ) == sizeof( float) ) ? \ __isnanf ( x ) : \ __isnan ( x ) ) This macro is not substituted becaus...
2020 Jan 29
3
Floating point semantic modes
...r constrained intrinsics is considering all manner of FP exceptions that could be raised, including the distinction between QNaN and SNaN. The default LLVM IR definition does not support this distinction. We seem to have an issue with isnan() in clang though. If you call isnan() you get a call to __isnan() which should be fine (assuming the library does the right thing), but we're translating __builtin_isnan() to x!=x. That's not what we should be doing if except_behavior isn't "ignore". > excess precision handling is missing from this list which matters for x87 and m68k...
2018 Jan 09
0
[cfe-dev] Why is #pragma STDC FENV_ACCESS not supported?
...= (!isnan(d) ? (int)d : 45); > return x; > } > > ... becomes this: > > define signext i32 @foo(double) local_unnamed_addr #0 !dbg !10 { > tail call void @llvm.dbg.value(metadata double %0, i64 0, metadata !15, > metadata !17), !dbg !18 > %2 = tail call signext i32 @__isnan(double %0) #3, !dbg !19 > %3 = icmp eq i32 %2, 0, !dbg !19 > %4 = fptosi double %0 to i32, !dbg !20 > %5 = select i1 %3, i32 %4, i32 45, !dbg !19 > tail call void @llvm.dbg.value(metadata i32 %5, i64 0, metadata !16, > metadata !17), !dbg !21 > ret i32 %5, !dbg !22 >...
2004 Jul 11
1
R + OS X + gcc 3.5 = not quite there ..
...src/starma.c:384: error: invalid lvalue in assignment relevant code: for (j = 0; j < nt; j++) if(!ISNAN(tmp = G->resid[j])) { nu++; sigma2 += tmp * tmp; } problem: ISNAN changed obviously as the pre-processing result shows: if(!(( ( sizeof ( tmp = G->resid[j] ) == sizeof(double) ) ? __isnand ( (double)tmp = G->resid[j] ) : ( sizeof ( tmp = G->resid[j] ) == sizeof( float) ) ? __isnanf ( (float)tmp = G->resid[j] ) : __isnan ( ( long double )tmp = G->resid[j] ) )!=0)) { nu++; sigma2 += tmp * tmp; } fix: get the assignment out of ISNAN: for (j = 0; j < nt; j++) { t...
2018 Jan 09
2
[cfe-dev] Why is #pragma STDC FENV_ACCESS not supported?
...> return x; > } > > ... becomes this: > > define signext i32 @foo(double) local_unnamed_addr #0 !dbg !10 { > tail call void @llvm.dbg.value(metadata double %0, i64 0, > metadata !15, metadata !17), !dbg !18 > %2 = tail call signext i32 @__isnan(double %0) #3, !dbg !19 > %3 = icmp eq i32 %2, 0, !dbg !19 > %4 = fptosi double %0 to i32, !dbg !20 > %5 = select i1 %3, i32 %4, i32 45, !dbg !19 > tail call void @llvm.dbg.value(metadata i32 %5, i64 0, metadata > !16, metadata !17), !dbg !21 > re...
2012 Feb 18
0
Re: [Qemu-devel] [PATCH] build: add needed missing libraries libm and librt
...gt;> libm is used in cutils.c, but the library was not specified >> when linking some binaries, throwing the following error: >> >> cutils.o: In function `strtosz_suffix_unit': >> /home/royger/xen-clean/tools/qemu-xen-dir/cutils.c:354: undefined >> reference to `__isnan' >> /home/royger/xen-clean/tools/qemu-xen-dir/cutils.c:357: undefined >> reference to `modf' >> collect2: ld returned 1 exit status >> >> According to modf man page [0], -lm should be used when linking. >> >> librt is used in qemu-time.c, but again...
2018 Jan 08
4
[cfe-dev] Why is #pragma STDC FENV_ACCESS not supported?
...t;math.h> int foo(double d) { int x = (!isnan(d) ? (int)d : 45); return x; } ... becomes this: define signext i32 @foo(double) local_unnamed_addr #0 !dbg !10 { tail call void @llvm.dbg.value(metadata double %0, i64 0, metadata !15, metadata !17), !dbg !18 %2 = tail call signext i32 @__isnan(double %0) #3, !dbg !19 %3 = icmp eq i32 %2, 0, !dbg !19 %4 = fptosi double %0 to i32, !dbg !20 %5 = select i1 %3, i32 %4, i32 45, !dbg !19 tail call void @llvm.dbg.value(metadata i32 %5, i64 0, metadata !16, metadata !17), !dbg !21 ret i32 %5, !dbg !22 } So the fptosi gets moved _above_...
2018 Jan 09
0
[cfe-dev] Why is #pragma STDC FENV_ACCESS not supported?
...= (!isnan(d) ? (int)d : 45); > return x; > } > > ... becomes this: > > define signext i32 @foo(double) local_unnamed_addr #0 !dbg !10 { > tail call void @llvm.dbg.value(metadata double %0, i64 0, metadata !15, > metadata !17), !dbg !18 > %2 = tail call signext i32 @__isnan(double %0) #3, !dbg !19 > %3 = icmp eq i32 %2, 0, !dbg !19 > %4 = fptosi double %0 to i32, !dbg !20 > %5 = select i1 %3, i32 %4, i32 45, !dbg !19 > tail call void @llvm.dbg.value(metadata i32 %5, i64 0, metadata !16, > metadata !17), !dbg !21 > ret i32 %5, !dbg !22 >...
2020 Jan 27
11
Floating point semantic modes
Hi all, I'm trying to put together a set of rules for how the various floating point semantic modes should be handled in clang. A lot of this information will be relevant to other front ends, but the details are necessarily bound to a front end implementation so I'm framing the discussion here in terms of clang. Other front ends can choose to follow clang or not. The existence of this set