0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd::b64: Adjust for types most amenable to vectorizing lookup phase.

This commit is contained in:
Jason Volk 2020-08-11 14:19:32 -07:00
parent 3cf8b949bf
commit c941e13ed0
2 changed files with 7 additions and 2 deletions

View file

@ -13,7 +13,7 @@
namespace ircd::b64
{
using dictionary_element = char;
using dictionary_element = int;
using dictionary = [[aligned(64)]] dictionary_element[64];
extern const dictionary

View file

@ -251,10 +251,15 @@ noexcept
for(j = 0; j < 8; ++j)
sh[i][j] &= 0x3f;
u32x8 res[8];
for(i = 0; i < 8; ++i)
for(j = 0; j < 8; ++j)
res[i][j] = dict[sh[i][j]];
u8x64 ret;
for(i = 0, k = 0; i < 8; ++i)
for(j = 0; j < 8; ++j)
ret[k++] = dict[sh[i][j]];
ret[k++] = res[i][j];
return ret;
}