mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 08:23:56 +01:00
ircd::b64: Adjust for types most amenable to vectorizing lookup phase.
This commit is contained in:
parent
3cf8b949bf
commit
c941e13ed0
2 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue