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

More x86 const generics conversions #1047

Conversation

lqd
Copy link
Member

@lqd lqd commented Mar 5, 2021

This PR converts the following intrinsics to use const generics:

x86/aes.rs: (which I believe completes this file)

  • _mm_aeskeygenassist_si128

x86_64/sse41.rs: (which I believe completes this file)

  • _mm_extract_epi64
  • _mm_insert_epi64

x86_64/avx2.rs: (which I believe completes this file)

  • _mm256_extract_epi64

x86/sha.rs: (which I believe completes this file)

  • _mm_sha1rnds4_epu32

x86/pclmulqdq.rs: (which I believe completes this file)

  • _mm_clmulepi64_si128

most of x86/avx512bw.rs:

  • _mm512_cmp_epu16_mask
  • _mm512_mask_cmp_epu16_mask
  • _mm256_cmp_epu16_mask
  • _mm256_mask_cmp_epu16_mask
  • _mm_cmp_epu16_mask
  • _mm_mask_cmp_epu16_mask
  • _mm512_cmp_epu8_mask
  • _mm512_mask_cmp_epu8_mask
  • _mm256_cmp_epu8_mask
  • _mm256_mask_cmp_epu8_mask
  • _mm_cmp_epu8_mask
  • _mm_mask_cmp_epu8_mask
  • _mm512_cmp_epi16_mask
  • _mm512_mask_cmp_epi16_mask
  • _mm256_cmp_epi16_mask
  • _mm256_mask_cmp_epi16_mask
  • _mm_cmp_epi16_mask
  • _mm_mask_cmp_epi16_mask
  • _mm512_cmp_epi8_mask
  • _mm512_mask_cmp_epi8_mask
  • _mm256_cmp_epi8_mask
  • _mm256_mask_cmp_epi8_mask
  • _mm_cmp_epi8_mask
  • _mm_mask_cmp_epi8_mask
  • _mm512_slli_epi16
  • _mm512_mask_slli_epi16
  • _mm512_maskz_slli_epi16
  • _mm_maskz_slli_epi16
  • _mm512_srli_epi16
  • _mm512_mask_srli_epi16
  • _mm512_maskz_srli_epi16
  • _mm256_mask_srli_epi16
  • _mm256_maskz_srli_epi16
  • _mm_mask_srli_epi16
  • _mm_maskz_srli_epi16
  • _mm512_srai_epi16
  • _mm512_mask_srai_epi16
  • _mm512_maskz_srai_epi16
  • _mm512_mask_shufflelo_epi16
  • _mm512_maskz_shufflelo_epi16
  • _mm256_mask_shufflelo_epi16
  • _mm256_maskz_shufflelo_epi16
  • _mm_mask_shufflelo_epi16
  • _mm_maskz_shufflelo_epi16
  • _mm512_mask_shufflehi_epi16
  • _mm512_maskz_shufflehi_epi16
  • _mm256_mask_shufflehi_epi16
  • _mm256_maskz_shufflehi_epi16
  • _mm_mask_shufflehi_epi16
  • _mm_maskz_shufflehi_epi16
  • _mm512_dbsad_epu8
  • _mm512_mask_dbsad_epu8
  • _mm512_maskz_dbsad_epu8
  • _mm256_dbsad_epu8
  • _mm256_mask_dbsad_epu8
  • _mm256_maskz_dbsad_epu8
  • _mm_dbsad_epu8
  • _mm_mask_dbsad_epu8
  • _mm_maskz_dbsad_epu8
  • _mm512_mask_alignr_epi8
  • _mm512_maskz_alignr_epi8
  • _mm256_mask_alignr_epi8
  • _mm256_maskz_alignr_epi8
  • _mm_mask_alignr_epi8
  • _mm_maskz_alignr_epi8

There are some interesting cases in this file, where some immediates are u32s while elsewhere most of them are i32s. Not a big deal unless one of those intrinsics calls the others: we can't easily cast between the 2 types, even (to the extent of my abilities) via the associated const trick to cast. min_const_generics refuses to compile such a naive trick constant in this position (and we cannot naively use either these immediates in the const expressions casts with {}). (There are around 10 cases like this in this file).

x86/rtm.rs: (which I believe completes this file)

  • _xabort

(it may be wishful thinking on my part, but while working on these conversions the past few days, it felt like incremental check builds are slowly but surely getting faster)

@rust-highfive
Copy link

r? @Amanieu

(rust-highfive has picked a reviewer for you, use r? to override)

@lqd lqd force-pushed the const_generics_6_the_const_and_the_furious_tokyo_drift branch 3 times, most recently from 481c587 to 47ddf88 Compare March 5, 2021 00:58
@lqd lqd force-pushed the const_generics_6_the_const_and_the_furious_tokyo_drift branch 9 times, most recently from 29df0de to 050d981 Compare March 5, 2021 02:42
@lqd
Copy link
Member Author

lqd commented Mar 5, 2021

Something seems to be going wrong with the CI on the wasm32-wasi target 🤔 I tried bisecting using the CI, but it seems to fail all the time regardless of the commits I include, and the failure seems strange

failed to instantiate "/checkout/target/wasm32-wasi/release/deps/core_arch-72e8d59d4ebc41b6.wasm"
1: unknown import: `env::llvm.wasm.widen.low.signed.v8i16.v16i8` has not been defined

does that sound familiar to anyone ?

@Amanieu
Copy link
Member

Amanieu commented Mar 5, 2021

This is probably because of the upgrade to LLVM 12 (rust-lang/rust#81451).

Just disable wasm CI for now and create an issue.

The LLVM12 upgrade in rustc may be causing issues
@lqd
Copy link
Member Author

lqd commented Mar 5, 2021

CI passes so I created #1048 to track re-enabling the WASM builder after this PR lands

@lqd lqd marked this pull request as ready for review March 5, 2021 03:26
@Amanieu Amanieu merged commit 4b0591c into rust-lang:master Mar 5, 2021
@lqd lqd deleted the const_generics_6_the_const_and_the_furious_tokyo_drift branch March 5, 2021 09:13
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.

3 participants