Created
February 2, 2026 01:57
-
-
Save nmoinvaz/97e573365d571d52c6c8c0fcc75e98e8 to your computer and use it in GitHub Desktop.
Zlib-ng functable without fallbacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Set up generic C code fallbacks | |
| #ifndef WITH_ALL_FALLBACKS | |
| // Only use necessary generic functions when no suitable simd versions are available. | |
| // These conditions mirror the native_* defines in arch/*_functions.h headers. | |
| # if (defined(X86_SSE2) && defined(__SSE2__)) || (defined(ARCH_X86) && defined(ARCH_64BIT)) | |
| ft.adler32 = &adler32_c; | |
| ft.adler32_copy = &adler32_copy_c; | |
| ft.crc32 = &crc32_braid; | |
| ft.crc32_copy = &crc32_copy_braid; | |
| # elif (defined(ARM_NEON) && (defined(__ARM_NEON__) || defined(__ARM_NEON))) || defined(ARM_NOCHECK_NEON) | |
| ft.crc32 = &crc32_braid; | |
| ft.crc32_copy = &crc32_copy_braid; | |
| # elif defined(POWER8_VSX) && defined(_ARCH_PWR8) && defined(__VSX__) | |
| # ifndef POWER9 | |
| ft.compare256 = &compare256_c; | |
| ft.longest_match = &longest_match_c; | |
| ft.longest_match_slow = &longest_match_slow_c; | |
| # endif | |
| # ifndef POWER8_VSX_CRC32 | |
| ft.crc32 = &crc32_braid; | |
| ft.crc32_copy = &crc32_copy_braid; | |
| # endif | |
| # elif defined(LOONGARCH_LSX) && defined(__loongarch_sx) | |
| # ifndef LOONGARCH_CRC | |
| ft.crc32 = &crc32_braid; | |
| ft.crc32_copy = &crc32_copy_braid; | |
| # endif | |
| # endif | |
| #else // WITH_ALL_FALLBACKS | |
| ft.adler32 = &adler32_c; | |
| ft.adler32_copy = &adler32_copy_c; | |
| ft.chunkmemset_safe = &chunkmemset_safe_c; | |
| ft.compare256 = &compare256_c; | |
| ft.crc32 = &crc32_braid; | |
| ft.crc32_copy = &crc32_copy_braid; | |
| ft.inflate_fast = &inflate_fast_c; | |
| ft.longest_match = &longest_match_c; | |
| ft.longest_match_slow = &longest_match_slow_c; | |
| ft.slide_hash = &slide_hash_c; | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment