Uh oh!
There was an error while loading. Please reload this page.
Add x86 intrinsics for bit manipulation (BMI 1.0, BMI 2.0, and TBM). - #34412
Conversation
rust-highfive
commented
Jun 22, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
…0, BMI 2.0, and TBM.
7ee154e to
483bec7Comparegnzlbg
commented
Jun 23, 2016
I don' have access to all the platforms that the SIMD crate supports. Is there a better way to test it than compiling the SIMD crate for all the platforms it supports? |
gnzlbg
commented
Jun 24, 2016
@huonw you used to work on the SIMD crate, any ideas about how to test it? |
brson
commented
Jun 25, 2016
Might be good to get some more eyes on this still. Previous issue didn't generate much discussion. Niko's on vacation. r? @nrc |
alexcrichton
commented
Jun 27, 2016
Currently the |
nrc
commented
Jun 27, 2016
I like the looks of this PR. I'm not sure about the second commit - I don't understand the issues there. So, r? @alexcrichton |
It is what @alexcrichton mentioned above, the I could probably have used The second commit allows having differently named instruction sets per platform, e.g.,
While |
alexcrichton
commented
Jun 28, 2016
Discussed during the libs triage meeting yesterday, the conclusion was that this is fine to merge, thanks for the PR @gnzlbg! We're in general pretty amenable to adding any support for fancy intrinsics like this, although we'd be much more hesitant about adding bits and pieces to the standard library, but that's not happening here! |
bors
commented
Jun 29, 2016
⌛ Testing commit 483bec7 with merge 849864d... |
bors
commented
Jun 29, 2016
💔 Test failed - auto-linux-64-x-android-t |
gnzlbg
commented
Jun 29, 2016
It's my first PR so I don't really know what to look for in the build logs yet to figure out what failed, but this looks like some sort of time out while compiling. |
alexcrichton
commented
Jun 29, 2016
Ah no worries that just means that the Android build timed out, which is unlikely to be related to this patch. so let's just... @bors: retry |
gnzlbg
commented
Jun 30, 2016
Maybe I did something wrong? |
alexcrichton
commented
Jun 30, 2016
Oh nah this PR is fine, we're just having a lot of automation trouble lately apparently so it may take awhile for bors to get around to this PR |
bors
commented
Jul 1, 2016
⌛ Testing commit 483bec7 with merge 7e269b2... |
bors
commented
Jul 1, 2016
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
gnzlbg
commented
Jul 1, 2016
@bors: retry |
bors
commented
Jul 1, 2016
⌛ Testing commit 483bec7 with merge f8be993... |
bors
commented
Jul 1, 2016
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
gnzlbg
commented
Jul 1, 2016
gnzlbg
commented
Jul 5, 2016
@bors: retry |
1 similar comment
GuillaumeGomez
commented
Jul 5, 2016
@bors: retry |
bors
commented
Jul 5, 2016
…r=alexcrichton Add x86 intrinsics for bit manipulation (BMI 1.0, BMI 2.0, and TBM). This PR adds the LLVM x86 intrinsics for the bit manipulation instruction sets (BMI 1.0, BMI 2.0, and TBM). The objective of this pull-request is to allow building a library that implements all the algorithms offered by those instruction sets, using compiler intrinsics for the targets that support them (by means of `target_feature`). The target features added are: - `bmi`: Bit Manipulation Instruction Set 1.0, available in Intel >= Haswell and AMD's >= Jaguar/Piledriver, - `bmi2`: Bit Manipulation Instruction Set 2.0, available in Intel >= Haswell and AMD's >= Excavator, - `tbm`: Trailing Bit Manipulation, available only in AMD's Piledriver (won't be available in newer CPUs). The intrinsics added are: - BMI 1.0: - `bextr`: Bit field extract (with register). - BMI 2.0: - `bzhi`: Zero high bits starting with specified bit position. - `pdep`: Parallel bits deposit. - `pext`: Parallel bits extract. - TBM: - `bextri`: Bit field extract (with immediate).
This PR adds the LLVM x86 intrinsics for the bit manipulation instruction sets (BMI 1.0, BMI 2.0, and TBM).
The objective of this pull-request is to allow building a library that implements all the algorithms offered by those instruction sets, using compiler intrinsics for the targets that support them (by means of
target_feature).The target features added are:
bmi: Bit Manipulation Instruction Set 1.0, available in Intel >= Haswell and AMD's >= Jaguar/Piledriver,bmi2: Bit Manipulation Instruction Set 2.0, available in Intel >= Haswell and AMD's >= Excavator,tbm: Trailing Bit Manipulation, available only in AMD's Piledriver (won't be available in newer CPUs).The intrinsics added are:
bextr: Bit field extract (with register).bzhi: Zero high bits starting with specified bit position.pdep: Parallel bits deposit.pext: Parallel bits extract.bextri: Bit field extract (with immediate).