Experimental support for stdsimd types (#154)

This commit is contained in:
Scallop Ye 2022-12-18 07:13:52 +08:00 committed by GitHub
parent 4c37652113
commit 2c8ce95548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 54 additions and 0 deletions

View File

@ -26,6 +26,7 @@ unsound_ptr_pod_impl = []
# NOT SEMVER SUPPORTED! TEMPORARY ONLY!
nightly_portable_simd = []
nightly_stdsimd = []
[dependencies]
bytemuck_derive = { version = "1.2.1", path = "derive", optional = true }

View File

@ -2,6 +2,7 @@
#![warn(missing_docs)]
#![allow(clippy::match_like_matches_macro)]
#![cfg_attr(feature = "nightly_portable_simd", feature(portable_simd))]
#![cfg_attr(feature = "nightly_stdsimd", feature(stdsimd))]
//! This crate gives small utilities for casting between plain data types.
//!

View File

@ -321,3 +321,29 @@ where
core::simd::LaneCount<N>: core::simd::SupportedLaneCount,
{
}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86::__m128bh {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86::__m256bh {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86::__m512 {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86::__m512bh {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86::__m512d {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86::__m512i {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86_64::__m128bh {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86_64::__m256bh {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86_64::__m512 {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86_64::__m512bh {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86_64::__m512d {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Pod for x86_64::__m512i {}

View File

@ -354,3 +354,29 @@ where
core::simd::LaneCount<N>: core::simd::SupportedLaneCount,
{
}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86::__m128bh {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86::__m256bh {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86::__m512 {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86::__m512bh {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86::__m512d {}
#[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86::__m512i {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86_64::__m128bh {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86_64::__m256bh {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86_64::__m512 {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86_64::__m512bh {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86_64::__m512d {}
#[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))]
unsafe impl Zeroable for x86_64::__m512i {}