From a61ee2fed6b250638601d10077578e399497d596 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 1 Nov 2024 10:11:35 -0400 Subject: [PATCH] Some more SIMD tweaks now I try it with waveshapers (#144) Trying the SIMD trick with sst-waveshapers required these changes which add M128i and make the script a bit more robust --- include/sst/basic-blocks/simd/setup.h | 2 ++ scripts/fix_simd.pl | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/sst/basic-blocks/simd/setup.h b/include/sst/basic-blocks/simd/setup.h index b11f773..5a29608 100644 --- a/include/sst/basic-blocks/simd/setup.h +++ b/include/sst/basic-blocks/simd/setup.h @@ -98,10 +98,12 @@ #if defined(SST_SIMD_NATIVE_X86) || defined(SIMDE_UNAVAILABLE) #define SIMD_MM(x) _mm_##x #define SIMD_M128 __m128 +#define SIMD_M128I __m128i #define SIMD_MM_SHUFFLE _MM_SHUFFLE #else #define SIMD_MM(x) simde_mm_##x #define SIMD_M128 simde__m128 +#define SIMD_M128I simde__m128i #define SIMD_MM_SHUFFLE SIMDE_MM_SHUFFLE #endif diff --git a/scripts/fix_simd.pl b/scripts/fix_simd.pl index 292dd4e..a9d93b8 100755 --- a/scripts/fix_simd.pl +++ b/scripts/fix_simd.pl @@ -32,7 +32,8 @@ sub findfiles s/__m128 (\S+) =/auto $1 =/g; # Replacement two. Any other __m128 goes to SIMD_M128 - s/__m128 /SIMD_M128 /g; + s/__m128([, ])/SIMD_M128$1/g; + s/__m128i([, ])/SIMD_M128I$1/g; # Replacement three. Any _mm_foo_bar goes to SIMD_MM(foo_bar) s/_mm_([^\(]+)\(/SIMD_MM($1)(/g;