[llvm-bugs] [Bug 43374] New: arm: silent == and != and __builtin_isnan compile to signaling compare
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Sep 20 03:28:32 PDT 2019
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: unassignedbugs at nondot.org
Reporter: szabolcs.nagy at arm.com
CC: htmldeveloper at gmail.com, llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190920/23eb0660/attachment.html>
More information about the llvm-bugs
mailing list