diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /contrib/libs/base64/avx2/enc_head.c | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/base64/avx2/enc_head.c')
-rw-r--r-- | contrib/libs/base64/avx2/enc_head.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/contrib/libs/base64/avx2/enc_head.c b/contrib/libs/base64/avx2/enc_head.c index 5b03c7f71b..3d05b0bd04 100644 --- a/contrib/libs/base64/avx2/enc_head.c +++ b/contrib/libs/base64/avx2/enc_head.c @@ -1,23 +1,23 @@ -// Assume that *out is large enough to contain the output. -// Theoretically it should be 4/3 the length of src. -const uint8_t *c = (const uint8_t *)src; -uint8_t *o = (uint8_t *)out; - -// Use local temporaries to avoid cache thrashing: -size_t outl = 0; -struct avx2_base64_state st; -st.bytes = state->bytes; -st.carry = state->carry; - -// Turn three bytes into four 6-bit numbers: -// in[0] = 00111111 -// in[1] = 00112222 -// in[2] = 00222233 -// in[3] = 00333333 - -// Duff's device, a for() loop inside a switch() statement. Legal! -switch (st.bytes) -{ - for (;;) - { - case 0: +// Assume that *out is large enough to contain the output. +// Theoretically it should be 4/3 the length of src. +const uint8_t *c = (const uint8_t *)src; +uint8_t *o = (uint8_t *)out; + +// Use local temporaries to avoid cache thrashing: +size_t outl = 0; +struct avx2_base64_state st; +st.bytes = state->bytes; +st.carry = state->carry; + +// Turn three bytes into four 6-bit numbers: +// in[0] = 00111111 +// in[1] = 00112222 +// in[2] = 00222233 +// in[3] = 00333333 + +// Duff's device, a for() loop inside a switch() statement. Legal! +switch (st.bytes) +{ + for (;;) + { + case 0: |