From b99d5f23d5f6b32db1ab90fb548fda5cabd23cda Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 23 Jul 2024 15:38:36 +0300 Subject: [PATCH] extract bitsel to a function table --- src/utils/bits.c | 22 +++++++++++----------- src/utils/calls.h | 3 +++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/utils/bits.c b/src/utils/bits.c index 525b8fc8..89099c59 100644 --- a/src/utils/bits.c +++ b/src/utils/bits.c @@ -1,11 +1,20 @@ #include "../core.h" +#include "../utils/calls.h" #include "mut.h" #if SINGELI_SIMD #define SINGELI_FILE bits #include "../utils/includeSingeli.h" - #define bitselFns simd_bitsel + INIT_GLOBAL BitSelFn* bitselFns = simd_bitsel; +#else + #define BITSEL_DEF(E) void bitsel_##E(void* rp, u64* bp, u64 e0i, u64 e1i, u64 ia) { for (usz i=0; i2⋆53), or (x≠(i64)x) extern INIT_GLOBAL RangeFn getRange_fns[el_f64+1]; // limited to ≤el_f64 + +typedef void (*BitSelFn)(void*,u64*,u64,u64,u64); +extern INIT_GLOBAL BitSelFn* bitselFns;