From 5e98f455e3c11d4f263cb9473bb2f3e5d9e18ab7 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 25 Apr 2024 19:39:00 -0700 Subject: [PATCH] Moved dispatching defines to halfvec.h [skip ci] --- src/bitutils.h | 20 ++------------------ src/halfvec.h | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/bitutils.h b/src/bitutils.h index 8844aee..ae3a575 100644 --- a/src/bitutils.h +++ b/src/bitutils.h @@ -3,29 +3,13 @@ #include "postgres.h" +#include "halfvec.h" /* for USE_DISPATCH */ + /* Check version in first header */ #if PG_VERSION_NUM < 120000 #error "Requires PostgreSQL 12+" #endif -/* We use two types of dispatching: intrinsics and target_clones */ -/* TODO Move to better place */ -#ifndef DISABLE_DISPATCH -/* Only enable for more recent compilers to keep build process simple */ -#if defined(__x86_64__) && defined(__GNUC__) && __GNUC__ >= 8 -#define USE_DISPATCH -#elif defined(__x86_64__) && defined(__clang_major__) && __clang_major__ >= 7 -#define USE_DISPATCH -#elif defined(_M_AMD64) && defined(_MSC_VER) && _MSC_VER >= 1920 -#define USE_DISPATCH -#endif -#endif - -/* target_clones requires glibc */ -#if defined(USE_DISPATCH) && defined(__gnu_linux__) -#define USE_TARGET_CLONES -#endif - #if defined(USE_DISPATCH) #define BIT_DISPATCH #endif diff --git a/src/halfvec.h b/src/halfvec.h index 6b76fcb..d5c56d3 100644 --- a/src/halfvec.h +++ b/src/halfvec.h @@ -5,7 +5,23 @@ #include -#include "bitutils.h" +/* We use two types of dispatching: intrinsics and target_clones */ +/* TODO Move to better place */ +#ifndef DISABLE_DISPATCH +/* Only enable for more recent compilers to keep build process simple */ +#if defined(__x86_64__) && defined(__GNUC__) && __GNUC__ >= 8 +#define USE_DISPATCH +#elif defined(__x86_64__) && defined(__clang_major__) && __clang_major__ >= 7 +#define USE_DISPATCH +#elif defined(_M_AMD64) && defined(_MSC_VER) && _MSC_VER >= 1920 +#define USE_DISPATCH +#endif +#endif + +/* target_clones requires glibc */ +#if defined(USE_DISPATCH) && defined(__gnu_linux__) +#define USE_TARGET_CLONES +#endif #if defined(USE_DISPATCH) #define HALFVEC_DISPATCH