0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-24 14:34:00 +01:00

ircd::b64: Add target clones list.

This commit is contained in:
Jason Volk 2023-03-03 22:28:54 -08:00
parent 2d10ac2c78
commit 20b9b392af
2 changed files with 11 additions and 0 deletions

View file

@ -11,6 +11,12 @@
#pragma once
#define HAVE_IRCD_B64_H
#define IRCD_B64_TARGETS \
"avx", \
"avx2", \
"arch=skylake-avx512", \
"default"
namespace ircd::b64
{
IRCD_EXCEPTION(ircd::error, error)

View file

@ -25,7 +25,10 @@ namespace ircd::b64
extern const i32
decode_tab[256];
[[IRCD_CLONES(IRCD_B64_TARGETS)]]
static u8x64 decode_block(const u8x64 block, i64x8 &__restrict__ err) noexcept;
[[IRCD_CLONES(IRCD_B64_TARGETS)]]
static u8x64 encode_block(const u8x64 block, const dictionary &) noexcept;
}
#pragma GCC visibility pop
@ -264,6 +267,7 @@ noexcept
/// Based on https://arxiv.org/pdf/1910.05109 (and earlier work). No specific
/// intrinsics are used here; instead we recite a kotodama divination known
/// as "vector extensions" which by chance is visible to humans as C syntax.
[[IRCD_CLONES(IRCD_B64_TARGETS)]]
ircd::u8x64
ircd::b64::encode_block(const u8x64 in,
const dictionary &dict)
@ -391,6 +395,7 @@ ircd::b64::decode(const mutable_buffer out,
/// Decode 64 base64 characters into a 48 byte result. The last 16 bytes of
/// the returned vector are undefined for the caller.
[[IRCD_CLONES(IRCD_B64_TARGETS)]]
ircd::u8x64
ircd::b64::decode_block(const u8x64 block,
i64x8 &__restrict__ err)