Skip to content

Commit

Permalink
Some more SIMD tweaks now I try it with waveshapers (#144)
Browse files Browse the repository at this point in the history
Trying the SIMD trick with sst-waveshapers required these changes
which add M128i and make the script a bit more robust
  • Loading branch information
baconpaul authored Nov 1, 2024
1 parent 677b6e4 commit a61ee2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/sst/basic-blocks/simd/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion scripts/fix_simd.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a61ee2f

Please sign in to comment.