pub trait Swizzle<const INPUT_LANES: usize, const OUTPUT_LANES: usize> {
const INDEX: [usize; OUTPUT_LANES];
// Provided method
fn swizzle<T>(vector: Simd<T, INPUT_LANES>) -> Simd<T, OUTPUT_LANES>
where T: SimdElement,
LaneCount<INPUT_LANES>: SupportedLaneCount,
LaneCount<OUTPUT_LANES>: SupportedLaneCount { ... }
}
🔬This is a nightly-only experimental API. (
portable_simd
#86656)Expand description
从另一个 vector 的元素创建一个 vector。
Required Associated Constants§
sourceconst INDEX: [usize; OUTPUT_LANES]
const INDEX: [usize; OUTPUT_LANES]
🔬This is a nightly-only experimental API. (
portable_simd
#86656)从输入 vector 的 lanes 映射到输出 vector。
Provided Methods§
sourcefn swizzle<T>(vector: Simd<T, INPUT_LANES>) -> Simd<T, OUTPUT_LANES>where
T: SimdElement,
LaneCount<INPUT_LANES>: SupportedLaneCount,
LaneCount<OUTPUT_LANES>: SupportedLaneCount,
fn swizzle<T>(vector: Simd<T, INPUT_LANES>) -> Simd<T, OUTPUT_LANES>where T: SimdElement, LaneCount<INPUT_LANES>: SupportedLaneCount, LaneCount<OUTPUT_LANES>: SupportedLaneCount,
🔬This is a nightly-only experimental API. (
portable_simd
#86656)从 vector
的 lanes 创建一个新的 vector。
Lane i
的输出为 vector[Self::INDEX[i]]
。