On Thu, May 19, 2016 at 12:07:42PM +0300, Henri Sivonen wrote:
> On Wed, May 18, 2016 at 8:32 PM, Benjamin Smedberg
> <benja...@smedbergs.us> wrote:
> > Can we require SSE2 for Mozilla builds of Firefox for Linux? Yes, I am
> > comfortable making that decision today.
> 
> Thank you! I filed
> https://bugzilla.mozilla.org/show_bug.cgi?id=1274196 for this.
> 
> > Should we also take actions that prevent anyone from supporting non-SSE2
> > codepaths? I don't know. There seem to be at least a few cases that this
> > affects:
> >
> > Rust and its support for non-SSE2 arches
> >
> > This seems to be both about build-time targeting and runtime dynamic
> > selection. I don't personally understand the cost/benefit tradeoff here.
> 
> There are two levels of complication with run-time selection:
> 
>  1) Since inline asm isn't allowed in stable-channel Rust, executing
> the cpuid instruction must be done in some other way, which leads
> either to having to make the crate (that could otherwise be a
> standalone Rust library) depend on Gecko's existing CPU sniffing
> infrastructure or to having to link some ad hoc cpuid-execution
> non-Rust object to the crate that could otherwise be a simple
> pure-Rust crate.
> 
>  2) Since LLVM and, by extension, rustc currently require the compiler
> instruction set targeting options to be the same throughout the
> compilation unit, if the main crate is compiled without SSE2 to cater
> for the non-SSE2 case, the SSE2-enabled versions of functions need to
> be put in a separate crate, which is considerably less nice than what
> rustc lets you do if you want to supply SSE2 and ALU-only alternatives
> for a function such that the selection is done at compile time. In
> particular, if you want to avoid having two copies of SSE2 code, one
> in the main crate for build-time selection and the other in the
> SSE2-only helper crate, you have to put the single copy in the helper
> crate, which means that the preferred case (SSE2 enabled at build
> time) is made more complex, too.

I don't think anyone suggested to add support for runtime selection of
SSE2 for code that is not inline asm.

> The problem with build-time selection is that the non-SSE2 target
> isn't the target that the Rust community tests the most actively.
> (Just like, evidently, Microsoft doesn't actively test the non-SSE
> target of MSVC.)

If distro's Rust compiler doesn't target SSE2, they'll obviously be
testing that. But it's not really a concern for you to have. It's
theirs.

Mike
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to