enable SIMDe backend

This commit is contained in:
Konstantnos Margaritis 2023-11-21 17:13:33 +00:00
parent b068087240
commit a8e9b9069e
9 changed files with 40 additions and 10 deletions

View File

@ -52,7 +52,7 @@ template <uint16_t S>
static really_inline
SuperVector<S> blockDoubleMask(SuperVector<S> mask1_lo, SuperVector<S> mask1_hi, SuperVector<S> mask2_lo, SuperVector<S> mask2_hi, SuperVector<S> chars);
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
#if defined(ARCH_IA32) || defined(ARCH_X86_64) || defined(SIMDE_BACKEND)
#include "x86/shufti.hpp"
#elif defined(ARCH_ARM32) || defined(ARCH_AARCH64)
#include "arm/shufti.hpp"

View File

@ -45,7 +45,7 @@ template <uint16_t S>
static really_inline
const SuperVector<S> blockSingleMask(SuperVector<S> shuf_mask_lo_highclear, SuperVector<S> shuf_mask_lo_highset, SuperVector<S> chars);
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
#if defined(ARCH_IA32) || defined(ARCH_X86_64) || defined(SIMDE_BACKEND)
#include "x86/truffle.hpp"
#elif defined(ARCH_ARM32) || defined(ARCH_AARCH64)
#include "arm/truffle.hpp"

View File

@ -71,7 +71,7 @@ const u8 *vermicelliDoubleMaskedBlock(SuperVector<S> const data, SuperVector<S>
SuperVector<S> const mask1, SuperVector<S> const mask2,
u8 const c1, u8 const c2, u8 const m1, u8 const m2, u8 const *buf, u16 const len);
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
#if defined(ARCH_IA32) || defined(ARCH_X86_64) || defined(SIMDE_BACKEND)
#include "x86/vermicelli.hpp"
#elif defined(ARCH_ARM32) || defined(ARCH_AARCH64)
#include "arm/vermicelli.hpp"

View File

@ -41,7 +41,7 @@
#include <string.h> // for memcpy
#if !defined(HAVE_SIMD_128_BITS)
#if !defined(HAVE_SIMD_128_BITS) && !defined(SIMDE_BACKEND)
#error "You need at least a 128-bit capable SIMD engine!"
#endif // HAVE_SIMD_128_BITS
@ -88,7 +88,7 @@ static inline void print_m128_2x64(const char *label, m128 vec) {
#define print_m128_2x64(label, vec) ;
#endif
#if !defined(ARCH_IA32) && !defined(ARCH_X86_64)
#if !defined(ARCH_IA32) && !defined(ARCH_X86_64) && !defined(SIMDE_BACKEND)
#define ZEROES_8 0, 0, 0, 0, 0, 0, 0, 0
#define ZEROES_31 ZEROES_8, ZEROES_8, ZEROES_8, 0, 0, 0, 0, 0, 0, 0
#define ZEROES_32 ZEROES_8, ZEROES_8, ZEROES_8, ZEROES_8

View File

@ -51,6 +51,31 @@
#include "util/arch/arm/bitutils.h"
#elif defined(ARCH_PPC64EL)
#include "util/arch/ppc64el/bitutils.h"
#else
#include "util/arch/common/bitutils.h"
#define clz32_impl clz32_impl_c
#define clz64_impl clz64_impl_c
#define ctz32_impl ctz32_impl_c
#define ctz64_impl ctz64_impl_c
#define lg2_impl lg2_impl_c
#define lg2_64_impl lg2_64_impl_c
#define findAndClearLSB_32_impl findAndClearLSB_32_impl_c
#define findAndClearLSB_64_impl findAndClearLSB_64_impl_c
#define findAndClearMSB_32_impl findAndClearMSB_32_impl_c
#define findAndClearMSB_64_impl findAndClearMSB_64_impl_c
#define compress32_impl compress32_impl_c
#define compress64_impl compress64_impl_c
#define compress128_impl compress128_impl_c
#define expand32_impl expand32_impl_c
#define expand64_impl expand64_impl_c
#define expand128_impl expand128_impl_c
#define bf64_iterate_impl bf64_iterate_impl_c
#define bf64_set_impl bf64_set_impl_c
#define bf64_unset_impl bf64_unset_impl_c
#define rank_in_mask32_impl rank_in_mask32_impl_c
#define rank_in_mask64_impl rank_in_mask64_impl_c
#define pext32_impl pext32_impl_c
#define pext64_impl pext64_impl_c
#endif
static really_inline

View File

@ -74,8 +74,6 @@
# endif
#elif defined(USE_PPC64EL_ALTIVEC_H)
#include <altivec.h>
#else
#error no intrinsics file
#endif
#endif // INTRINSICS_H

View File

@ -49,7 +49,7 @@ const u8 *first_zero_match_inverted(const u8 *buf, SuperVector<S> v, u16 const l
template <u16 S>
const u8 *last_zero_match_inverted(const u8 *buf, SuperVector<S> v, u16 len = S);
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
#if defined(ARCH_IA32) || defined(ARCH_X86_64) || defined(SIMDE_BACKEND)
#include "util/arch/x86/match.hpp"
#elif defined(ARCH_ARM32) || defined(ARCH_AARCH64)
#include "util/arch/arm/match.hpp"

View File

@ -42,8 +42,13 @@
#include "util/arch/ppc64el/simd_types.h"
#endif
#if !defined(m128) && !defined(HAVE_SIMD_128_BITS)
typedef struct ALIGN_DIRECTIVE {u64a hi; u64a lo;} m128;
#if defined(SIMDE_BACKEND)
#define VECTORSIZE 16
#define SIMDE_ENABLE_NATIVE_ALIASES
#define SIMDE_NO_NATIVE
#include "simde/simde/x86/sse4.2.h"
typedef simde__m128i m128;
#define HAVE_SIMD_128_BITS
#endif
#if !defined(m256) && !defined(HAVE_SIMD_256_BITS)

View File

@ -67,6 +67,8 @@ extern const char vbs_mask_data[];
#include "util/arch/arm/simd_utils.h"
#elif defined(ARCH_PPC64EL)
#include "util/arch/ppc64el/simd_utils.h"
#elif defined(SIMDE_BACKEND)
#include "util/arch/simde/simd_utils.h"
#endif
#include "util/arch/common/simd_utils.h"