diff options
author | Gabriel Ganne <gabriel.ganne@enea.com> | 2017-12-14 16:20:37 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-12-16 19:32:25 +0000 |
commit | 8e66b9bf4ba90279631e6a0e8ccc2eab5f9156c2 (patch) | |
tree | e76209cf954906eda9c0f50b029f87637bdb9099 /src/vppinfra/crc32.h | |
parent | f9dc9c4629bb9756013f7c727d67e0d3990cff3c (diff) |
Use crc32 wrapper (VPP-1086)
This allows arm platforms to also take advantage of crc32 hardware
acceleration.
* add a wrapper for crc32_u64. It's the only one really used. Using it
instead of a call to clib_crc32c() eases building symmetrical hash
functions.
* replace #ifdef on SSE4 by a test on clib_crc32c_uses_intrinsics.
Note: keep the test on i386
* fix typo in lb test log
Change-Id: I03a0897b70f6c1717e6901d93cf0fe024d5facb5
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
Diffstat (limited to 'src/vppinfra/crc32.h')
-rw-r--r-- | src/vppinfra/crc32.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vppinfra/crc32.h b/src/vppinfra/crc32.h index 242278ff241..340b539558e 100644 --- a/src/vppinfra/crc32.h +++ b/src/vppinfra/crc32.h @@ -22,6 +22,8 @@ #define clib_crc32c_uses_intrinsics #include <x86intrin.h> +#define crc32_u64 _mm_crc32_u64 + static_always_inline u32 clib_crc32c (u8 * s, int len) { @@ -52,6 +54,9 @@ clib_crc32c (u8 * s, int len) #define clib_crc32c_uses_intrinsics #include <arm_acle.h> + +#define crc32_u64 __crc32cd + static_always_inline u32 clib_crc32c (u8 * s, int len) { |