You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code essentially calls _mm256_cmp_pd(a, b, _CMP_NEQ_UQ) to test four f64 packed as a __m256d for inequality. In particular, it should therefore return all zeros when called with the same value for a and b. This works for opt-level 0 to 2 but fails with opt-level=3.
$ rustc -g -C opt-level=2 avx.rs && ./avx
$ rustc -g -C opt-level=3 avx.rs && ./avx
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `"__m256d(0.0, 0.0, 0.0, 0.0)"`,
right: `"__m256d(NaN, NaN, 0.0, 0.0)"`', avx.rs:37:2
note: Run with `RUST_BACKTRACE=1` for a backtrace.
$ rustc --version
rustc 1.31.1 (b6c32da9b 2018-12-18)
Thanks @parched, it does look like a dup of #50154. I confirm that if I use target_feature(enable = "avx") on the caller the bug does not occur. I'm closing.
The following code essentially calls
_mm256_cmp_pd(a, b, _CMP_NEQ_UQ)
to test four f64 packed as a __m256d for inequality. In particular, it should therefore return all zeros when called with the same value for a and b. This works for opt-level 0 to 2 but fails with opt-level=3.Test code:
Looking at the generated code (opt-level=3) using objdump, the avx_cmp function is compiled as:
So it expects its arguments in registers ymm0 and ymm1, while nothing in the code sets them. The call site has:
The text was updated successfully, but these errors were encountered: