Closed
Description
The following example should obviously compile to a panic, as the documentation of _mm512_reduce_add_pd
mentions nothing about NaNs not being respected:
#![feature(stdsimd)]
use core::arch::x86_64::*;
#[no_mangle]
unsafe fn test() -> f64 {
let ret = _mm512_reduce_add_pd(_mm512_set_pd(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, f64::NAN));
if ret.is_nan() {
panic!("hi")
}
ret
}
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:
.LCPI0_0:
.quad 0x7ff8000000000000
test:
vmovsd xmm0, qword ptr [rip + .LCPI0_0]
ret
Metadata
Metadata
Assignees
Labels
Area: SIMD (Single Instruction Multiple Data)Category: This is a bug.Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessMedium priorityProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.