Merge branch 'master' into micropoly

This commit is contained in:
Nathan Vegdahl 2021-03-30 16:01:04 +09:00
commit 582118c52f
2 changed files with 5 additions and 3 deletions

View File

@ -69,7 +69,7 @@ fn lk_scramble(mut n: u32, scramble: u32) -> u32 {
n = n.wrapping_add(n << 2);
n ^= n.wrapping_mul(0xfe9b5742);
n = n.wrapping_add(scramble);
n = n.wrapping_mul(scramble | 1);
n = n.wrapping_mul((scramble >> 16) | 1);
n
}
@ -82,7 +82,7 @@ fn lk_scramble_int4(mut n: Int4, scramble: u32) -> Int4 {
n += n << 2;
n ^= n * [0xfe9b5742; 4].into();
n += scramble;
n *= scramble | [1; 4].into();
n *= (scramble >> 16) | [1; 4].into();
n
}

View File

@ -22,7 +22,9 @@ pub(crate) mod sse {
}
}
pub fn get(self, i: usize) -> u32 {
/// For testing.
#[allow(dead_code)]
fn get(self, i: usize) -> u32 {
let n: [u32; 4] = unsafe { std::mem::transmute(self) };
n[i]
}