-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
32-bit tests failing on master #621
Comments
cc @rkruppe |
This example does not have the issue: #![feature(stdsimd, asm)]
#![feature(mmx_target_feature)]
use std::arch::x86::*;
fn main() {
unsafe {
something_mmx();
foo();
}
}
#[target_feature(enable = "mmx")]
unsafe fn something_mmx() {
another(_mm_setzero_si64());
#[target_feature(enable = "mmx")]
unsafe fn another(_: __m64) {
}
asm!("emms" : : : : "volatile")
}
#[target_feature(enable = "sse2")]
unsafe fn foo() {
let a = _mm_setr_pd(1.0, 2.0);
let b = _mm_setr_pd(5.0, 10.0);
let r = _mm_add_sd(a, b);
assert_eq_m128d(r);
}
#[target_feature(enable = "sse2")]
unsafe fn assert_eq_m128d(a: __m128d) {
println!("{:?}", a);
} |
Fascinating! If that's the case then I suspect this is a "regression" from rust-lang/rust#56243 because all tests are run in the same thread now instead of all tests being run in a separate thread. I'm still not really sure what's going on with these registers, but the documentation for the In any case I think I can now fix this on CI! |
We historically have run single-threaded verbose tests because we were faulting all over the place due to bugs in rustc itself, primarily around calling conventions and passing values around. Those bugs have all since been fixed so we should be clear to run multithreaded tests quietly on CI nowadays! Closes rust-lang#621
I think we should also fill an LLVM bug about this. AFAICT we are using the |
These seem to hint at this issue: https://bugs.llvm.org/show_bug.cgi?id=15388 If they are not exactly the same issue, they are at least closely related with what's going on here. |
We historically have run single-threaded verbose tests because we were faulting all over the place due to bugs in rustc itself, primarily around calling conventions and passing values around. Those bugs have all since been fixed so we should be clear to run multithreaded tests quietly on CI nowadays! Closes rust-lang#621
We historically have run single-threaded verbose tests because we were faulting all over the place due to bugs in rustc itself, primarily around calling conventions and passing values around. Those bugs have all since been fixed so we should be clear to run multithreaded tests quietly on CI nowadays! Closes rust-lang#621
We historically have run single-threaded verbose tests because we were faulting all over the place due to bugs in rustc itself, primarily around calling conventions and passing values around. Those bugs have all since been fixed so we should be clear to run multithreaded tests quietly on CI nowadays! Closes rust-lang#621
We historically have run single-threaded verbose tests because we were faulting all over the place due to bugs in rustc itself, primarily around calling conventions and passing values around. Those bugs have all since been fixed so we should be clear to run multithreaded tests quietly on CI nowadays! Closes #621
@alexcrichton did you had to use #638 adds a proper intrinsic for that ( |
Yes that wasn't bound but I wasn't keen on adding that to every test using mmx... |
I'll see if I can update the |
Starting with last night's nightly our CI is failing on 32-bit platforms for reasons that look like:
I've done some debugging and I don't think this is a regression, but rather this has always been a bug and we just haven't exposed it until now. I've been able to reproduce some of the above failures with:
That program has an invalid
NaN
in the end, but if you comment out the call tosomething_mmx()
it passes.My best guess as to what's going on is that MMX is causing things to be sad. Something about floating point state and whatnot seems to be persisting across executions. I've been able to determine some bad stuff starts from a
fld
instruction, which apparently loads a floating point operand onto the floating point stack. The operand being loaded is1.0
as a double, but when loaded onto the stack it loads as-NaN
for whatever reasons. Thefctrl
register (according to GDB) differs between the program execute with the call tosomething_mmx
and the program execution withoutsomething_mmx
, and presumably that's like masking something or tweaking something?I'm sort of lost at this point and curious if others have any idea what's going on here? Does using MMX things somehow break global state for the rest of the CPU?
The text was updated successfully, but these errors were encountered: