https://bugs.llvm.org/show_bug.cgi?id=43374
Bug ID: 43374
Summary: arm: silent == and != and __builtin_isnan compile to
signaling compare
Product: new-bugs
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedb...@nondot.org
Reporter: szabolcs.n...@arm.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org
for
int foo(float x) {
return __builtin_isnan(x) ? 0 : 1;
}
int bar(float x) {
return x!=x ? 0 : 1;
}
i get
foo:
vcmpe.f32 s0, s0
vmrs APSR_nzcv, fpscr
mov r0, #0
movvc r0, #1
bx lr
bar:
vcmpe.f32 s0, s0
vmrs APSR_nzcv, fpscr
mov r0, #0
movvc r0, #1
bx lr
in standard conform compilation mode, i expected vcmp.f32 instead of vcmpe.f32.
in principle the difference is not observable if FENV_ACCESS is off, but since
clang does not support toggling that switch it must be assumed to be always on
for conforming behaviour and then != and is* operations must be non-signaling
(iso c annex f requirement).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs