Skip to content
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

Use SIMD in `gfx` when possible #10900

Closed
wants to merge 1 commit into from
Closed

Use SIMD in `gfx` when possible #10900

wants to merge 1 commit into from

Conversation

@mmatyas
Copy link
Contributor

mmatyas commented Apr 28, 2016

Currently SIMD support is enabled by checking the target architecture (x86_64 and AArch64). A better approach would be to check if a SIMD feature is actually available on the platform, by using cfg_target_feature. This patch enables SIMD code if possible, which will cause speedup on Android and ARM embedded devices.


This change is Reviewable

@highfive
Copy link

highfive commented Apr 28, 2016

warning Warning warning

  • These commits modify gfx code, but no tests are modified. Please consider adding a test!
@mmatyas
Copy link
Contributor Author

mmatyas commented Apr 28, 2016

Fixed the tidy warning.

@metajack
Copy link
Contributor

metajack commented Apr 28, 2016

@bors-servo r+


Reviewed 3 of 3 files at r1.
Review status: 2 of 3 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Apr 28, 2016

📌 Commit f81c1b1 has been approved by metajack

@bors-servo
Copy link
Contributor

bors-servo commented Apr 28, 2016

Testing commit f81c1b1 with merge 3229782...

bors-servo added a commit that referenced this pull request Apr 28, 2016
Use SIMD in `gfx` when possible

Currently SIMD support is enabled by checking the target architecture (x86_64 and AArch64). A better approach would be to check if a SIMD feature is actually available on the platform, by using `cfg_target_feature`. This patch enables SIMD code if possible, which will cause speedup on Android and ARM embedded devices.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10900)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 28, 2016

💔 Test failed - arm32

@metajack
Copy link
Contributor

metajack commented Apr 28, 2016

common.rs:19:5: 19:22 error: unresolved importarm::neon::common. Could not findneoninarm[E0432]

@mmatyas
Copy link
Contributor Author

mmatyas commented Apr 28, 2016

The problem is here in simd: https://github.com/huonw/simd/blob/master/src/common.rs#L18, I'll send a PR there too.

@mmatyas
Copy link
Contributor Author

mmatyas commented Apr 28, 2016

Hm, but that would also require to only compile simd if needed. I wonder if there is a way to decide that in Cargo.toml.

@bors-servo
Copy link
Contributor

bors-servo commented Apr 29, 2016

The latest upstream changes (presumably #10830) made this pull request unmergeable. Please resolve the merge conflicts.

@mmatyas mmatyas force-pushed the mmatyas:simdglyph branch from b41fdfd to 538dc0d Apr 29, 2016
@mmatyas
Copy link
Contributor Author

mmatyas commented Apr 29, 2016

Rebased and squashed.

@nox
Copy link
Member

nox commented Apr 29, 2016

@mmatyas Could you file an issue about this on the simd crate?

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Apr 29, 2016

📌 Commit 538dc0d has been approved by nox

@notriddle
Copy link
Contributor

notriddle commented Sep 12, 2016

Are there any Android experts who'd be able to help with this?

@bors-servo
Copy link
Contributor

bors-servo commented Nov 17, 2016

The latest upstream changes (presumably #14246) made this pull request unmergeable. Please resolve the merge conflicts.

@mmatyas mmatyas force-pushed the mmatyas:simdglyph branch from f10b3ed to 196eb6e Nov 18, 2016
@mmatyas
Copy link
Contributor Author

mmatyas commented Nov 18, 2016

Rebased, hopefully it can land after Android gets fixed.

@nox nox removed the S-needs-rebase label Nov 28, 2016
@nox
Copy link
Member

nox commented Nov 28, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Nov 28, 2016

Trying commit 196eb6e with merge 13e9ffe...

bors-servo added a commit that referenced this pull request Nov 28, 2016
Use SIMD in `gfx` when possible

Currently SIMD support is enabled by checking the target architecture (x86_64 and AArch64). A better approach would be to check if a SIMD feature is actually available on the platform, by using `cfg_target_feature`. This patch enables SIMD code if possible, which will cause speedup on Android and ARM embedded devices.

<!-- Reviewable:start -->

---

This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10900)

<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 28, 2016

💔 Test failed - linux-rel-wpt

@highfive
Copy link

highfive commented Nov 28, 2016

  ▶ TIMEOUT [expected PASS] /_mozilla/css/border_radius_elliptical_a.html
  │ 
  │ VMware, Inc.
  │ Gallium 0.4 on softpipe
  └ 3.3 (Core Profile) Mesa 12.0.1
@nox nox removed the S-tests-failed label Nov 28, 2016
@nox
Copy link
Member

nox commented Nov 28, 2016

This is #14229.

How can we test that there is no issue on Android anymore?

@mmatyas
Copy link
Contributor Author

mmatyas commented Nov 28, 2016

At the moment, Android just shows a gray screen (see #13154), by "Android gets fixed", I've meant that issue :)
If everything works correctly, we can test it with etc/ci/check_dynamic_symbols.py, it should not show any unknown symbols. But since there have been some changes in the Android build, that script may need an update too, after the current display problems get fixed.

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Dec 13, 2016

@bors-servo try

Running a try build so that I can check and see if the symbols have changed. Will r+ if it looks good.

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Dec 13, 2016

@bors-servo retry

bors-servo added a commit that referenced this pull request Dec 13, 2016
Use SIMD in `gfx` when possible

Currently SIMD support is enabled by checking the target architecture (x86_64 and AArch64). A better approach would be to check if a SIMD feature is actually available on the platform, by using `cfg_target_feature`. This patch enables SIMD code if possible, which will cause speedup on Android and ARM embedded devices.

<!-- Reviewable:start -->

---

This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10900)

<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2016

Trying commit 196eb6e with merge 3581b3a...

@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2016

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Dec 14, 2016

This seems to have failed: http://build.servo.org/builders/android/builds/4447/steps/compile/logs/stdio

error[E0308]: mismatched types
   --> /home/servo/.cargo/git/checkouts/simd-a428b8cc9c1d1986/0d85d25/src/arm/neon.rs:506:45
    |
506 |                         let x = super::$min(lo, hi);
    |                                             ^^ expected struct `arm::neon::u32x2`, found struct `u32x2`
...
524 |     bools! {
    |     - in this macro invocation
    |
    = note: expected type `arm::neon::u32x2`
    = note:    found type `u32x2`

error[E0308]: mismatched types
   --> /home/servo/.cargo/git/checkouts/simd-a428b8cc9c1d1986/0d85d25/src/arm/neon.rs:506:49
    |
506 |                         let x = super::$min(lo, hi);
    |                                                 ^^ expected struct `arm::neon::u32x2`, found struct `u32x2`
...
524 |     bools! {
    |     - in this macro invocation
    |
    = note: expected type `arm::neon::u32x2`
    = note:    found type `u32x2`

error[E0308]: mismatched types
   --> /home/servo/.cargo/git/checkouts/simd-a428b8cc9c1d1986/0d85d25/src/arm/neon.rs:515:45
    |
515 |                         let x = super::$max(lo, hi);
    |                                             ^^ expected struct `arm::neon::u32x2`, found struct `u32x2`
...
524 |     bools! {
    |     - in this macro invocation
    |
    = note: expected type `arm::neon::u32x2`
    = note:    found type `u32x2`

error[E0308]: mismatched types
   --> /home/servo/.cargo/git/checkouts/simd-a428b8cc9c1d1986/0d85d25/src/arm/neon.rs:515:49
    |
515 |                         let x = super::$max(lo, hi);
    |                                                 ^^ expected struct `arm::neon::u32x2`, found struct `u32x2`
...
524 |     bools! {
    |     - in this macro invocation
    |
    = note: expected type `arm::neon::u32x2`
    = note:    found type `u32x2`

error[E0308]: mismatched types
   --> /home/servo/.cargo/git/checkouts/simd-a428b8cc9c1d1986/0d85d25/src/arm/neon.rs:506:45
    |
506 |                         let x = super::$min(lo, hi);
    |                                             ^^ expected struct `arm::neon::u32x2`, found struct `u32x2`
...
524 |     bools! {
    |     - in this macro invocation
    |
    = note: expected type `arm::neon::u32x2`
    = note:    found type `u32x2`

error[E0308]: mismatched types
   --> /home/servo/.cargo/git/checkouts/simd-a428b8cc9c1d1986/0d85d25/src/arm/neon.rs:506:49
    |
506 |                         let x = super::$min(lo, hi);
    |                                                 ^^ expected struct `arm::neon::u32x2`, found struct `u32x2`
...
524 |     bools! {
    |     - in this macro invocation
    |
    = note: expected type `arm::neon::u32x2`
    = note:    found type `u32x2`

error[E0308]: mismatched types
   --> /home/servo/.cargo/git/checkouts/simd-a428b8cc9c1d1986/0d85d25/src/arm/neon.rs:515:45
    |
515 |                         let x = super::$max(lo, hi);
    |                                             ^^ expected struct `arm::neon::u32x2`, found struct `u32x2`
...
524 |     bools! {
    |     - in this macro invocation
    |
    = note: expected type `arm::neon::u32x2`
    = note:    found type `u32x2`

error[E0308]: mismatched types
   --> /home/servo/.cargo/git/checkouts/simd-a428b8cc9c1d1986/0d85d25/src/arm/neon.rs:515:49
    |
515 |                         let x = super::$max(lo, hi);
    |                                                 ^^ expected struct `arm::neon::u32x2`, found struct `u32x2`
...
524 |     bools! {
    |     - in this macro invocation
    |
    = note: expected type `arm::neon::u32x2`
    = note:    found type `u32x2`

error: aborting due to 8 previous errors
@mmatyas mmatyas force-pushed the mmatyas:simdglyph branch from 196eb6e to 1fc36ca Dec 14, 2016
@mmatyas
Copy link
Contributor Author

mmatyas commented Dec 14, 2016

Hmm, I wonder if there was some kind of API change... cc @huonw. I've also rebased the patch to the current master.

@KiChjang
Copy link
Member

KiChjang commented Dec 14, 2016

@mmatyas Huon is prohibited from participating with any Rust projects (and discussions as well? Not sure). He might not respond.

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Dec 21, 2016

@mmatyas Should the new one you pushed work? I can do another try build. Or r+, now that we actually are gating on Android again!

@mmatyas
Copy link
Contributor Author

mmatyas commented Dec 22, 2016

Not yet, but I've just sent a PR to simd, as soon as that lands (and we start using it), this patch will compile fine too.

@nox
Copy link
Member

nox commented Feb 4, 2017

Superseded by #15381 with simd 0.2.0, thanks for keeping up with it!

@nox nox closed this Feb 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

You can’t perform that action at this time.