aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/vector_avx2.h6
-rw-r--r--src/vppinfra/vector_avx512.h11
-rw-r--r--src/vppinfra/vector_sse42.h6
3 files changed, 22 insertions, 1 deletions
diff --git a/src/vppinfra/vector_avx2.h b/src/vppinfra/vector_avx2.h
index f651392559b..3f0b397b828 100644
--- a/src/vppinfra/vector_avx2.h
+++ b/src/vppinfra/vector_avx2.h
@@ -81,6 +81,12 @@ u32x8_insert_hi (u32x8 v1, u32x4 v2)
return (u32x8) _mm256_inserti128_si256 ((__m256i) v1, (__m128i) v2, 1);
}
+static_always_inline u32
+u8x32_msb_mask (u8x32 v)
+{
+ return _mm256_movemask_epi8 ((__m256i) v);
+}
+
/* _extend_to_ */
/* *INDENT-OFF* */
#define _(f,t,i) \
diff --git a/src/vppinfra/vector_avx512.h b/src/vppinfra/vector_avx512.h
index ac4c09b8375..c1b7c42a260 100644
--- a/src/vppinfra/vector_avx512.h
+++ b/src/vppinfra/vector_avx512.h
@@ -27,6 +27,7 @@
_(f,32,8,ps) _(f,64,4,pd)
/* splat, load_unaligned, store_unaligned */
+/* *INDENT-OFF* */
#define _(t, s, c, i) \
static_always_inline t##s##x##c \
t##s##x##c##_splat (t##s x) \
@@ -43,7 +44,15 @@ t##s##x##c##_store_unaligned (t##s##x##c v, void *p) \
foreach_avx512_vec512i foreach_avx512_vec512u
#undef _
-#endif /* included_vector_avx512_h */
+/* *INDENT-ON* */
+
+static_always_inline u32
+u16x32_msb_mask (u16x32 v)
+{
+ return (u32) _mm512_movepi16_mask ((__m512i) v);
+}
+
+#endif /* included_vector_avx512_h */
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vppinfra/vector_sse42.h b/src/vppinfra/vector_sse42.h
index cf7f158b873..50aa662a925 100644
--- a/src/vppinfra/vector_sse42.h
+++ b/src/vppinfra/vector_sse42.h
@@ -574,6 +574,12 @@ i16x8_min_scalar (i16x8 x)
return _mm_extract_epi16 ((__m128i) x, 0);
}
+static_always_inline u16
+u8x16_msb_mask (u8x16 v)
+{
+ return _mm_movemask_epi8 ((__m128i) v);
+}
+
#undef _signed_binop
#endif /* included_vector_sse2_h */