enc_neon.c 482 B

1234567891011121314151617181920212223
  1. // If we have ARM NEON support, pick off 48 bytes at a time:
  2. while (srclen >= 48)
  3. {
  4. uint8x16x3_t str;
  5. uint8x16x4_t res;
  6. // Load 48 bytes and deinterleave:
  7. str = vld3q_u8((uint8_t *)c);
  8. // Reshuffle:
  9. res = enc_reshuffle(str);
  10. // Translate reshuffled bytes to the Base64 alphabet:
  11. res = enc_translate(res);
  12. // Interleave and store result:
  13. vst4q_u8((uint8_t *)o, res);
  14. c += 48; // 3 * 16 bytes of input
  15. o += 64; // 4 * 16 bytes of output
  16. outl += 64;
  17. srclen -= 48;
  18. }