-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
clarify simd_relaxed_fma non-determinism #133844
Conversation
Some changes occurred to the platform-builtins intrinsics. Make sure the cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @rust-lang/wg-const-eval |
ffaef08
to
f4217f4
Compare
headscratch Hmm. That would be kinda weird? I see your point, but it's a bit odd. |
It matches the usual principle that a SIMD op id equivalent to the corresponding scar op in a loop.
|
Hm. Apparently the version implemented by wasm's "Relaxed SIMD" is actually quite strict, where the nondeterministic choice is quite early: WebAssembly/relaxed-simd@c3f9359 It's still valid to lower a lax semantic to a stricter one, however, so having given it some more thought, this seems fine. LLVM indeed does not specify! I would never expect this to happen to a "natural" vector (pow2 elements, etc.) but I could definitely see it happening to a "packed" one... say, #[repr(packed(4))]
struct LoweredSimd {
fvec: Simd<f32, 4>,
single: f32,
} Then perhaps the code generation uses a libcall to @bors r+ |
…r=workingjubilee clarify simd_relaxed_fma non-determinism This is the safer spec in the sense that it is more likely to be satisfied by the backend -- and if people are okay with a non-deterministic result, I assume they don't care whether it's the same choice across all lanes or not? Cc `@calebzulawski` `@workingjubilee`
Rollup of 6 pull requests Successful merges: - rust-lang#127565 (Teach rustc about the Xtensa VaListImpl) - rust-lang#133844 (clarify simd_relaxed_fma non-determinism) - rust-lang#133867 (Fix "std" support status of some tier 3 targets) - rust-lang#133882 (Improve comments for the default backtrace printer) - rust-lang#133888 (Improve bootstrap job objects) - rust-lang#133898 (skip `setup::Hook` on non-git sources) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 6 pull requests Successful merges: - rust-lang#127565 (Teach rustc about the Xtensa VaListImpl) - rust-lang#133844 (clarify simd_relaxed_fma non-determinism) - rust-lang#133867 (Fix "std" support status of some tier 3 targets) - rust-lang#133882 (Improve comments for the default backtrace printer) - rust-lang#133888 (Improve bootstrap job objects) - rust-lang#133898 (skip `setup::Hook` on non-git sources) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#133844 - RalfJung:simd_relaxed_fma-nondet, r=workingjubilee clarify simd_relaxed_fma non-determinism This is the safer spec in the sense that it is more likely to be satisfied by the backend -- and if people are okay with a non-deterministic result, I assume they don't care whether it's the same choice across all lanes or not? Cc ``@calebzulawski`` ``@workingjubilee``
This is the safer spec in the sense that it is more likely to be satisfied by the backend -- and if people are okay with a non-deterministic result, I assume they don't care whether it's the same choice across all lanes or not?
Cc @calebzulawski @workingjubilee