-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-mediumMedium priorityMedium priorityPG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)Project group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-mediumMedium priorityMedium priorityPG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)Project group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.