arm_functions.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* arm_functions.h -- ARM implementations for arch-specific functions.
  2. * For conditions of distribution and use, see copyright notice in zlib.h
  3. */
  4. #ifndef ARM_FUNCTIONS_H_
  5. #define ARM_FUNCTIONS_H_
  6. #ifdef ARM_NEON
  7. uint32_t adler32_neon(uint32_t adler, const uint8_t *buf, size_t len);
  8. uint32_t chunksize_neon(void);
  9. uint8_t* chunkmemset_safe_neon(uint8_t *out, unsigned dist, unsigned len, unsigned left);
  10. # ifdef HAVE_BUILTIN_CTZLL
  11. uint32_t compare256_neon(const uint8_t *src0, const uint8_t *src1);
  12. uint32_t longest_match_neon(deflate_state *const s, Pos cur_match);
  13. uint32_t longest_match_slow_neon(deflate_state *const s, Pos cur_match);
  14. # endif
  15. void slide_hash_neon(deflate_state *s);
  16. void inflate_fast_neon(PREFIX3(stream) *strm, uint32_t start);
  17. #endif
  18. #ifdef ARM_ACLE
  19. uint32_t crc32_acle(uint32_t crc, const uint8_t *buf, size_t len);
  20. #endif
  21. #ifdef ARM_SIMD
  22. void slide_hash_armv6(deflate_state *s);
  23. #endif
  24. #ifdef DISABLE_RUNTIME_CPU_DETECTION
  25. // ARM - SIMD
  26. # if (defined(ARM_SIMD) && defined(__ARM_FEATURE_SIMD32)) || defined(ARM_NOCHECK_SIMD)
  27. # undef native_slide_hash
  28. # define native_slide_hash slide_hash_armv6
  29. # endif
  30. // ARM - NEON
  31. # if (defined(ARM_NEON) && (defined(__ARM_NEON__) || defined(__ARM_NEON))) || ARM_NOCHECK_NEON
  32. # undef native_adler32
  33. # define native_adler32 adler32_neon
  34. # undef native_chunkmemset_safe
  35. # define native_chunkmemset_safe chunkmemset_safe_neon
  36. # undef native_chunksize
  37. # define native_chunksize chunksize_neon
  38. # undef native_inflate_fast
  39. # define native_inflate_fast inflate_fast_neon
  40. # undef native_slide_hash
  41. # define native_slide_hash slide_hash_neon
  42. # ifdef HAVE_BUILTIN_CTZLL
  43. # undef native_compare256
  44. # define native_compare256 compare256_neon
  45. # undef native_longest_match
  46. # define native_longest_match longest_match_neon
  47. # undef native_longest_match_slow
  48. # define native_longest_match_slow longest_match_slow_neon
  49. # endif
  50. # endif
  51. // ARM - ACLE
  52. # if defined(ARM_ACLE) && defined(__ARM_ACLE) && defined(__ARM_FEATURE_CRC32)
  53. # undef native_crc32
  54. # define native_crc32 crc32_acle
  55. # endif
  56. #endif
  57. #endif /* ARM_FUNCTIONS_H_ */