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

Function rshift128

deps/jemalloc/test/src/SFMT.c:163–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161#if (!defined(HAVE_ALTIVEC)) && (!defined(HAVE_SSE2))
162#ifdef ONLY64
163static inline void rshift128(w128_t *out, w128_t const *in, int shift) {
164 uint64_t th, tl, oh, ol;
165
166 th = ((uint64_t)in->u[2] << 32) | ((uint64_t)in->u[3]);
167 tl = ((uint64_t)in->u[0] << 32) | ((uint64_t)in->u[1]);
168
169 oh = th >> (shift * 8);
170 ol = tl >> (shift * 8);
171 ol |= th << (64 - shift * 8);
172 out->u[0] = (uint32_t)(ol >> 32);
173 out->u[1] = (uint32_t)ol;
174 out->u[2] = (uint32_t)(oh >> 32);
175 out->u[3] = (uint32_t)oh;
176}
177#else
178static inline void rshift128(w128_t *out, w128_t const *in, int shift) {
179 uint64_t th, tl, oh, ol;

Callers 1

do_recursionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected