From 276d79b1fa139756477e4acdb6b5fac51f2acb90 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Mon, 23 Mar 2026 08:12:21 +0100 Subject: adding sse2 path --- cheesemap.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'cheesemap.h') diff --git a/cheesemap.h b/cheesemap.h index 7cdb2de..5d87a6c 100644 --- a/cheesemap.h +++ b/cheesemap.h @@ -13,14 +13,20 @@ extern "C" { #include #include -#include CM_OPT_ASSERT_PATH -#ifndef assert -#error "assert is not defined" +#ifdef CM_SSE2 +#include + +typedef __m128i group_t; +typedef uint16_t bitmask_t; +#define CM_GROUP_SIZE 16 +#define CM_NO_FALLBACK #endif +#ifndef CM_NO_FALLBACK typedef uintptr_t group_t; typedef group_t bitmask_t; #define CM_GROUP_SIZE __SIZEOF_POINTER__ +#endif //////////////////////////////// // cheesemap callback functions @@ -63,15 +69,6 @@ enum { }; -static inline uintptr_t cm_h1(cm_hash_t hash) { - return (uintptr_t)(hash >> CM_FP_SIZE); -} - -static inline uint8_t cm_h2(cm_hash_t hash) { - uintptr_t top = hash >> (sizeof(cm_hash_t) * CHAR_BIT - CM_FP_SIZE); - return (uint8_t)(top & CM_H2_MASK); -} - extern const uint8_t CM_CTRL_STATIC_EMPTY[CM_GROUP_SIZE]; struct cheesemap_raw { -- cgit v1.2.3