<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 - wasm32 reduce.fmin/fmax work incorrectly for <float x 32> vectors containing NaNs"
href="https://bugs.llvm.org/show_bug.cgi?id=38599">38599</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>wasm32 reduce.fmin/fmax work incorrectly for <float x 32> vectors containing NaNs
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>gonzalobg88@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This is an attempt at reporting Rust packed_simd/91
(<a href="https://github.com/rust-lang-nursery/packed_simd/issues/91">https://github.com/rust-lang-nursery/packed_simd/issues/91</a>).
There we have to functions, min_element and max_element, that work on packed
float vectors. For <4 x float> and min we emit the following LLVM-IR:
define float @min_4x32(<4 x float> %a) {
%b = tail call float @llvm.experimental.reduce.fmin.v4f32(<4 x float> %a)
ret float %b
}
declare float @llvm.experimental.reduce.fmin.v4f32(<4 x float>)
We have a test that initializes the first element of the vector with NaN, and
all other elements with 3.0, and checks that the result is 3.0.
This tests passes on wasm32-unknown-unknown for all f32 and f64 vectors except
for f32x16 (512-bit wide) vectors, where it fails for both the `min` and `max`
operations. Instead of returning `3.0`, this functions return `NaN` (the input
is `<float x16> <NaN, 3.0, ..., 3.0>`.</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>