diff options
| author | Nathan Moinvaziri <nathan@nathanm.com> | 2026-03-11 19:49:53 -0700 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2026-03-14 02:14:21 +0100 |
| commit | 8cd3ae20e37e4e7d38bc89b3fa7a88fe4b8af3b6 (patch) | |
| tree | 5b6013f7235f3d2f990c945aea5b463c630996b7 | |
| parent | 5195f0ba7e8d20201eae4d3ca31255522acf9cfc (diff) | |
| download | Project-Tick-8cd3ae20e37e4e7d38bc89b3fa7a88fe4b8af3b6.tar.gz Project-Tick-8cd3ae20e37e4e7d38bc89b3fa7a88fe4b8af3b6.zip | |
Add fallback for ARM CRC32 copy when compiling with no-unaligned-access
| -rw-r--r-- | arch/arm/crc32_armv8.c | 7 | ||||
| -rw-r--r-- | arch/arm/crc32_armv8_pmull_eor3.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/crc32_armv8.c b/arch/arm/crc32_armv8.c index b222a832e9..acc6e0be20 100644 --- a/arch/arm/crc32_armv8.c +++ b/arch/arm/crc32_armv8.c @@ -34,6 +34,13 @@ Z_INTERNAL Z_TARGET_CRC uint32_t crc32_armv8(uint32_t crc, const uint8_t *buf, s } Z_INTERNAL Z_TARGET_CRC uint32_t crc32_copy_armv8(uint32_t crc, uint8_t *dst, const uint8_t *src, size_t len) { +#if OPTIMAL_CMP >= 32 return crc32_copy_impl(crc, dst, src, len, 1); +#else + /* Without unaligned access, interleaved stores get decomposed into byte ops */ + crc = crc32_armv8(crc, src, len); + memcpy(dst, src, len); + return crc; +#endif } #endif diff --git a/arch/arm/crc32_armv8_pmull_eor3.c b/arch/arm/crc32_armv8_pmull_eor3.c index dbc5fadcf6..e0d5bf043b 100644 --- a/arch/arm/crc32_armv8_pmull_eor3.c +++ b/arch/arm/crc32_armv8_pmull_eor3.c @@ -354,6 +354,13 @@ Z_INTERNAL Z_TARGET_PMULL_EOR3 uint32_t crc32_armv8_pmull_eor3(uint32_t crc, con } Z_INTERNAL Z_TARGET_PMULL_EOR3 uint32_t crc32_copy_armv8_pmull_eor3(uint32_t crc, uint8_t *dst, const uint8_t *src, size_t len) { +#if OPTIMAL_CMP >= 32 return crc32_copy_impl(crc, dst, src, len, 1); +#else + /* Without unaligned access, interleaved stores get decomposed into byte ops */ + crc = crc32_armv8_pmull_eor3(crc, src, len); + memcpy(dst, src, len); + return crc; +#endif } #endif |
