[Bug 223415] lang/rust: don't require SSE2 on i386 (at least for binary packages)
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sat Nov 4 06:54:26 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223415
Bug ID: 223415
Summary: lang/rust: don't require SSE2 on i386 (at least for
binary packages)
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Keywords: patch
Severity: Affects Only Me
Priority: ---
Component: Individual Port(s)
Assignee: rust at FreeBSD.org
Reporter: jbeich at FreeBSD.org
Flags: maintainer-feedback?(rust at FreeBSD.org)
Assignee: rust at FreeBSD.org
Created attachment 187710
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=187710&action=edit
v0
Rust currently assumes SSE2 for all i686 targets. When adopted into existing
projects this means killing support for old hardware. For one, www/firefox
managed to avoid using -march= but due to encoding_rs pervasive usage now
requires SSE2. Users that want performance are better off using -C
target-cpu=native and/or switching to x86_64, anyway.
https://github.com/rust-lang/rust/blob/1.21.0/src/librustc_back/target/i686_unknown_freebsd.rs#L16
$ cat <<EOF >a.rs
#![feature(cfg_target_feature)]
fn main() {
if cfg!(target_feature = "sse2") {
println!("SSE2 code");
} else if cfg!(target_feature = "sse") {
println!("SSE code");
} else if cfg!(target_feature = "mmx") {
println!("MMX code");
} else {
println!("Generic code");
}
}
EOF
$ RUSTC_BOOTSTRAP=1 rustc a.rs
Before:
$ ./a
SSE2 code
$ objdump -d a | fgrep xmm | wc -l
631
After:
$ ./a
Generic code
$ objdump -d a | fgrep xmm | wc -l
15
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list