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

Function lshift128

deps/memkind/src/jemalloc/test/src/SFMT.c:202–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200 */
201#ifdef ONLY64
202static inline void lshift128(w128_t *out, w128_t const *in, int shift) {
203 uint64_t th, tl, oh, ol;
204
205 th = ((uint64_t)in->u[2] << 32) | ((uint64_t)in->u[3]);
206 tl = ((uint64_t)in->u[0] << 32) | ((uint64_t)in->u[1]);
207
208 oh = th << (shift * 8);
209 ol = tl << (shift * 8);
210 oh |= tl >> (64 - shift * 8);
211 out->u[0] = (uint32_t)(ol >> 32);
212 out->u[1] = (uint32_t)ol;
213 out->u[2] = (uint32_t)(oh >> 32);
214 out->u[3] = (uint32_t)oh;
215}
216#else
217static inline void lshift128(w128_t *out, w128_t const *in, int shift) {
218 uint64_t th, tl, oh, ol;

Callers 1

do_recursionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected