Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Nov 2017 06:54:24 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 223415] lang/rust: don't require SSE2 on i386 (at least for binary packages)
Message-ID:  <bug-223415-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223415

            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@FreeBSD.org
          Reporter: jbeich@FreeBSD.org
             Flags: maintainer-feedback?(rust@FreeBSD.org)
          Assignee: rust@FreeBSD.org

Created attachment 187710
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D187710&action=
=3Dedit
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=3D but due to encoding_rs pervasive usage now
requires SSE2. Users that want performance are better off using -C
target-cpu=3Dnative 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 =3D "sse2") {
          println!("SSE2 code");
      } else if cfg!(target_feature =3D "sse") {
          println!("SSE code");
      } else if cfg!(target_feature =3D "mmx") {
          println!("MMX code");
      } else {
          println!("Generic code");
      }
  }
  EOF

  $ RUSTC_BOOTSTRAP=3D1 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

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223415-13>