MCPcopy Create free account
hub / github.com/RustCrypto/utils / masksel

Function masksel

cmov/src/backends/soft.rs:214–219  ·  view source on GitHub ↗
(a: T, b: T, mask: T)

Source from the content-addressed store, hash-verified

212/// This function shouldn't be used with a mask that isn't `0` or `u*::MAX`.
213#[inline]
214fn masksel<T>(a: T, b: T, mask: T) -> T
215where
216 T: BitAnd<Output = T> + BitOr<Output = T> + Copy + Not<Output = T>,
217{
218 (a & !mask) | (b & mask)
219}
220
221#[cfg(test)]
222mod tests {

Callers 4

cmovnzMethod · 0.85
cmovzMethod · 0.85
cmovneMethod · 0.85
cmoveqMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected