Closed orlp closed 8 months ago
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-medium +T-libs +requires-nightly
Currently the intrinsic is implemented as simd_reduce_add_unordered
, which is lowered to LLVM with all the fast-math flags set. That is fixed in PR #120718 .
However, for these _mm512_reduce_{add,mul,min,max}_*
intrinsics, the behaviour should match how they are defined in https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=float*reduce*ps&expand=4560&ig_expand=5298,5343,5302,5396,5377,5302,5303
All of them follow the same pattern:
[lower,upper] = tmp;
tmp[i] = OP(lower[i], upper[i]);
The following example should obviously compile to a panic, as the documentation of
_mm512_reduce_add_pd
mentions nothing about NaNs not being respected:However, when compiled with
-C opt-level=3 -C target-cpu=cannonlake
on the latest nightly there is no panic generated, despite the output being NaN regardless: