<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - ARM long double NaN cannot be negated"
href="https://bugs.llvm.org/show_bug.cgi?id=46792">46792</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ARM long double NaN cannot be negated
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>10.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tydeman@tybor.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Using the following code to generate two NaNs, but with opposite signs, fails.
volatile long double ld_pnan, ld_mnan;
ld_pnan = 0.L / 0.L; /* NAN of either sign */
ld_mnan = -ld_pnan; /* flip sign -- fails */
Using __builtin_nanl("") in place of 0.L/0.L gets same failure.
It works for double and float.
This is on ARM cortex A53 with clang 10.0.0 on Manjaro Linux.
# flags for compiler
export CFLAGS="-H -std=c2x -O0 -m64 -march=armv8-a -mcpu=cortex-a53 \
-ffp-model=strict \
-ffp-exception-behavior=strict \
-fhonor-infinities \
-fhonor-nans \
-fmath-errno \
-fno-associative-math \
-fno-builtin \
-fno-finite-math-only \
-fno-reciprocal-math \
-fno-unsafe-math-optimizations \
-frounding-math \
-fsigned-zeros \
-fstrict-float-cast-overflow \
-ftrapping-math \
-Xclang -disable-llvm-optzns \
${INCS}"</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>