diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2018-12-13 12:50:42 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2018-12-14 11:17:24 -0800 |
| commit | ceee7f34f5cfae23f8b9f43314cf81cf26150b4f (patch) | |
| tree | 9996e89bca6cc36572af6c8f83059009bc453f7d /src/librustc_codegen_llvm | |
| parent | 1897657ef09eea3d0b0afbbbd154a12fbb8fbf3f (diff) | |
| download | rust-ceee7f34f5cfae23f8b9f43314cf81cf26150b4f.tar.gz rust-ceee7f34f5cfae23f8b9f43314cf81cf26150b4f.zip | |
rustc: Add an unstable `simd_select_bitmask` intrinsic
This is going to be required for binding a number of AVX-512 intrinsics in the `stdsimd` repository, and this intrinsic is the same as `simd_select` except that it takes a bitmask as the first argument instead of a SIMD vector. This bitmask is then transmuted into a `<NN x i8>` argument, depending on how many bits it is. cc rust-lang-nursery/stdsimd#310
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/intrinsic.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/intrinsic.rs b/src/librustc_codegen_llvm/intrinsic.rs index 8b26ada1576..e229f8d95cd 100644 --- a/src/librustc_codegen_llvm/intrinsic.rs +++ b/src/librustc_codegen_llvm/intrinsic.rs @@ -1192,7 +1192,7 @@ fn generic_simd_intrinsic( return Ok(bx.select(m_i1s, args[1].immediate(), args[2].immediate())); } - // every intrinsic takes a SIMD vector as its first argument + // every intrinsic below takes a SIMD vector as its first argument require_simd!(arg_tys[0], "input"); let in_ty = arg_tys[0]; let in_elem = arg_tys[0].simd_type(tcx); @@ -1296,6 +1296,7 @@ fn generic_simd_intrinsic( if name == "simd_select" { let m_elem_ty = in_elem; let m_len = in_len; + require_simd!(arg_tys[1], "argument"); let v_len = arg_tys[1].simd_size(tcx); require!(m_len == v_len, "mismatched lengths: mask length `{}` != other vector length `{}`", |
