W3cubDocs

/Rust

Function simd_select

pub const unsafe fn simd_select<M, T>(mask: M, if_true: T, if_false: T) -> T
🔬This is a nightly-only experimental API. (core_intrinsics)

Selects elements from a mask.

T must be a vector.

M must be an integer vector with the same length as T (but any element size).

For each element, if the corresponding value in mask is !0, select the element from if_true. If the corresponding value in mask is 0, select the element from if_false.

Safety

mask must only contain 0 and !0.

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/intrinsics/simd/fn.simd_select.html