Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/intgemm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intgemm/intrinsics.h')
-rw-r--r--intgemm/intrinsics.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/intgemm/intrinsics.h b/intgemm/intrinsics.h
index 67b36fc..9f370cd 100644
--- a/intgemm/intrinsics.h
+++ b/intgemm/intrinsics.h
@@ -9,6 +9,9 @@
#ifdef INTGEMM_COMPILER_SUPPORTS_AVX2
#include <immintrin.h>
#endif
+#ifdef INTGEMM_WORMHOLE
+#include <wasm_simd128.h>
+#endif
#include <cstdint>
@@ -92,10 +95,20 @@ template <> INTGEMM_SSE2 inline __m128 loadu_ps(const float* mem_addr) {
return _mm_loadu_ps(mem_addr);
}
INTGEMM_SSE2 static inline __m128i madd_epi16(__m128i first, __m128i second) {
+// https://bugzilla.mozilla.org/show_bug.cgi?id=1672160
+#ifdef INTGEMM_WORMHOLE
+ return wasm_v8x16_shuffle(first, second, 31, 0, 30, 2, 29, 4, 28, 6, 27, 8, 26, 10, 25, 12, 24, 2 /* PMADDWD */);
+#else
return _mm_madd_epi16(first, second);
+#endif
}
INTGEMM_SSSE3 static inline __m128i maddubs_epi16(__m128i first, __m128i second) {
+// https://bugzilla.mozilla.org/show_bug.cgi?id=1672160
+#ifdef INTGEMM_WORMHOLE
+ return wasm_v8x16_shuffle(first, second, 31, 0, 30, 2, 29, 4, 28, 6, 27, 8, 26, 10, 25, 12, 24, 1 /* PMADDUBSW */);
+#else
return _mm_maddubs_epi16(first, second);
+#endif
}
/*
* Missing max_epi8 for SSE2