codec.c 820 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include <stdint.h>
  2. #include <stddef.h>
  3. #include <stdlib.h>
  4. #include "../../../include/libbase64.h"
  5. #include "../../tables/tables.h"
  6. #include "../../codecs.h"
  7. #include "config.h"
  8. #include "../../env.h"
  9. #if HAVE_AVX512
  10. #include <immintrin.h>
  11. #include "../avx2/dec_reshuffle.c"
  12. #include "../avx2/dec_loop.c"
  13. #include "enc_reshuffle_translate.c"
  14. #include "enc_loop.c"
  15. #endif // HAVE_AVX512
  16. BASE64_ENC_FUNCTION(avx512)
  17. {
  18. #if HAVE_AVX512
  19. #include "../generic/enc_head.c"
  20. enc_loop_avx512(&s, &slen, &o, &olen);
  21. #include "../generic/enc_tail.c"
  22. #else
  23. BASE64_ENC_STUB
  24. #endif
  25. }
  26. // Reuse AVX2 decoding. Not supporting AVX512 at present
  27. BASE64_DEC_FUNCTION(avx512)
  28. {
  29. #if HAVE_AVX512
  30. #include "../generic/dec_head.c"
  31. dec_loop_avx2(&s, &slen, &o, &olen);
  32. #include "../generic/dec_tail.c"
  33. #else
  34. BASE64_DEC_STUB
  35. #endif
  36. }