Skip to content

Conversation

alexcrichton
Copy link
Member

This commit partially reverts #868 to restore the intrinsics to their
original implementation to avoid breaking changes. This is done while
rust-lang/rust#73166 is running through crater, and should unblock
rust-lang/rust#74482.

This commit partially reverts rust-lang#868 to restore the intrinsics to their
original implementation to avoid breaking changes. This is done while
rust-lang/rust#73166 is running through crater, and should unblock
rust-lang/rust#74482.
@rust-highfive
Copy link

r? @gnzlbg

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

r? @Amanieu

@rust-highfive rust-highfive assigned Amanieu and unassigned gnzlbg Jul 28, 2020
@Amanieu Amanieu merged commit 311d56c into rust-lang:master Jul 28, 2020
@alexcrichton alexcrichton deleted the unbreak branch July 28, 2020 16:40
jethrogb pushed a commit to jethrogb/stdsimd that referenced this pull request Sep 8, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 15, 2020
Update stdarch

This PR **changes the public signature** of the following functions in `core::arch::{x86, x86_64}`:
```patch
-pub unsafe fn _mm256_extract_epi8(a: __m256i, imm8: i32) -> i8
+pub unsafe fn _mm256_extract_epi8(a: __m256i, imm8: i32) -> i32
-pub unsafe fn _mm256_extract_epi16(a: __m256i, imm8: i32) -> i16
+pub unsafe fn _mm256_extract_epi16(a: __m256i, imm8: i32) -> i32
```

This change is desired so that these signatures
* are similar to those of the 128-bit versions `_mm_extract_epi8` and `_mm_extract_epi16`
* match the Intel definitions for the intrinsics
  * [RFC 2325](https://github.com/rust-lang/rfcs/blob/master/text/2325-stable-simd.md) specifies that the exact vendor function signatures should be used

A [crater run](rust-lang#73166 (comment)) revealed only a single breakage. The [vektor crate](https://github.com/AdamNiederer/vektor/blob/master/src/x86/avx2.rs#L2436-L2472) copied the incorrect signatures in `core` exactly to their own crate. The functions don't seem to be used by anyone anywhere.

Actual breakage is not expected, since due to the nature of the functions, users would generally write `_mm256_extract_epi8(...) as u8` or `_mm256_extract_epi16(...) as u16`.

See rust-lang/stdarch#868. Note that the changes from that stdarch PR have already partially landed in core after rust-lang/stdarch#878. This PR is now only about the remaining changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants