Optimizing mul_u32

This commit is contained in:
Tomasz Drwięga
2016-03-07 16:17:14 +01:00
parent 0fd52176dc
commit 4717be07d6
2 changed files with 15 additions and 36 deletions

View File

@@ -79,7 +79,7 @@ fn u256_full_mul(b: &mut Bencher) {
b.iter(|| {
let n = black_box(10000);
(0..n).fold(U256([rand::random::<u64>(), rand::random::<u64>(), rand::random::<u64>(), rand::random::<u64>()]),
|old, new| {
|old, _new| {
let U512(ref u512words) = old.full_mul(U256([rand::random::<u64>(), rand::random::<u64>(), rand::random::<u64>(), rand::random::<u64>()]));
U256([u512words[0], u512words[2], u512words[2], u512words[3]])
})