MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / vec_recursion

Function vec_recursion

deps/jemalloc/test/include/test/SFMT-alti.h:63–92  ·  view source on GitHub ↗

* This function represents the recursion formula in AltiVec and BIG ENDIAN. * @param a a 128-bit part of the interal state array * @param b a 128-bit part of the interal state array * @param c a 128-bit part of the interal state array * @param d a 128-bit part of the interal state array * @return output */

Source from the content-addressed store, hash-verified

61 * @return output
62 */
63JEMALLOC_ALWAYS_INLINE
64vector unsigned int vec_recursion(vector unsigned int a,
65 vector unsigned int b,
66 vector unsigned int c,
67 vector unsigned int d) {
68
69 const vector unsigned int sl1 = ALTI_SL1;
70 const vector unsigned int sr1 = ALTI_SR1;
71#ifdef ONLY64
72 const vector unsigned int mask = ALTI_MSK64;
73 const vector unsigned char perm_sl = ALTI_SL2_PERM64;
74 const vector unsigned char perm_sr = ALTI_SR2_PERM64;
75#else
76 const vector unsigned int mask = ALTI_MSK;
77 const vector unsigned char perm_sl = ALTI_SL2_PERM;
78 const vector unsigned char perm_sr = ALTI_SR2_PERM;
79#endif
80 vector unsigned int v, w, x, y, z;
81 x = vec_perm(a, (vector unsigned int)perm_sl, perm_sl);
82 v = a;
83 y = vec_sr(b, sr1);
84 z = vec_perm(c, (vector unsigned int)perm_sr, perm_sr);
85 w = vec_sl(d, sl1);
86 z = vec_xor(z, w);
87 y = vec_and(y, mask);
88 v = vec_xor(v, x);
89 z = vec_xor(z, y);
90 z = vec_xor(z, v);
91 return z;
92}
93
94/**
95 * This function fills the internal state array with pseudorandom

Callers 2

gen_rand_allFunction · 0.70
gen_rand_arrayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected