(&self, rhs: &Self, input: Condition, output: &mut Condition)
| 208 | impl CmovEq for [u8] { |
| 209 | #[inline] |
| 210 | fn cmovne(&self, rhs: &Self, input: Condition, output: &mut Condition) { |
| 211 | // Short-circuit the comparison if the slices are of different lengths, and set the output |
| 212 | // condition to the input condition. |
| 213 | if self.len() != rhs.len() { |
| 214 | *output = input; |
| 215 | return; |
| 216 | } |
| 217 | |
| 218 | let (self_chunks, self_remainder) = slice_as_chunks::<u8, WORD_SIZE>(self); |
| 219 | let (rhs_chunks, rhs_remainder) = slice_as_chunks::<u8, WORD_SIZE>(rhs); |
| 220 | |
| 221 | for (self_chunk, rhs_chunk) in self_chunks.iter().zip(rhs_chunks.iter()) { |
| 222 | let a = Word::from_ne_bytes(*self_chunk); |
| 223 | let b = Word::from_ne_bytes(*rhs_chunk); |
| 224 | a.cmovne(&b, input, output); |
| 225 | } |
| 226 | |
| 227 | cmovne_remainder(self_remainder, rhs_remainder, input, output); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | /// Implement [`CmovEq`] using a simple loop. |
no test coverage detected