diff options
author | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2017-04-24 12:47:24 +0200 |
---|---|---|
committer | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2017-04-24 12:47:24 +0200 |
commit | a7c7119009a65f2bf554faab19583650bf5fa0f7 (patch) | |
tree | d5692bdb31cf4cfc379746e3627b9cbe1eaede93 /functable.c | |
parent | 3443bd6a0085b6a8af51b80a4de42d411e2312ab (diff) |
- Add adler32 to functable
- Add missing call to functableinit from inflateinit
- Fix external direct calls to adler32 functions without calling functableinit
Diffstat (limited to 'functable.c')
-rw-r--r-- | functable.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/functable.c b/functable.c index 9887b99..7d34fad 100644 --- a/functable.c +++ b/functable.c @@ -11,6 +11,7 @@ # include "arch/x86/x86.h" #endif + #ifdef X86_SSE4_2_CRC_HASH extern Pos insert_string_sse(deflate_state *const s, const Pos str, unsigned int count); #elif defined(ARM_ACLE_CRC_HASH) @@ -23,13 +24,23 @@ extern void fill_window_sse(deflate_state *s); extern void fill_window_arm(deflate_state *s); #endif +#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) +extern uint32_t adler32_neon(uint32_t adler, const unsigned char *buf, size_t len); +#endif + + /* ========================================================================= * Initialize functable */ + +struct functable_s functable = {NULL,NULL,NULL}; + + ZLIB_INTERNAL void functableInit() { // Initialize defaults functable.insert_string=&insert_string_c; functable.fill_window=&fill_window_c; + functable.adler32=&adler32_c; // insert_string #ifdef X86_SSE4_2_CRC_HASH @@ -48,4 +59,9 @@ ZLIB_INTERNAL void functableInit() { #elif defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) functable.fill_window=&fill_window_arm; #endif + + // adler32 + #if (defined(__ARM_NEON__) || defined(__ARM_NEON)) + functable.adler32=&adler32_neon; + #endif } |