Created
July 17, 2017 21:20
-
-
Save alexcrichton/ba7626121c0454da2f576f392b7281b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::num::Wrapping as w; | |
#[no_mangle] | |
pub fn foo() { | |
let mut a = w::<u64>(0x9e3779b97f4a7c13); | |
let mut b = w::<u64>(0x9e3779b97f4a7c13); | |
let mut c = w::<u64>(0x9e3779b97f4a7c13); | |
let mut d = w::<u64>(0x9e3779b97f4a7c13); | |
let mut e = w::<u64>(0x9e3779b97f4a7c13); | |
let mut f = w::<u64>(0x9e3779b97f4a7c13); | |
let mut g = w::<u64>(0x9e3779b97f4a7c13); | |
let mut h = w::<u64>(0x9e3779b97f4a7c13); | |
for _ in 0..4 { | |
a=a-e; f=f^(h>>9); h=h+a; | |
b=b-f; g=g^(a<<9); a=a+b; | |
c=c-g; h=h^(b>>23); b=b+c; | |
d=d-h; a=a^(c<<15); c=c+d; | |
e=e-a; b=b^(d>>14); d=d+e; | |
f=f-b; c=c^(e<<20); e=e+f; | |
g=g-c; d=d^(f>>17); f=f+g; | |
h=h-d; e=e^(g<<14); g=g+h; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment