summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vector_sse2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/vector_sse2.h')
-rw-r--r--src/vppinfra/vector_sse2.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/vppinfra/vector_sse2.h b/src/vppinfra/vector_sse2.h
index 6830d5c6104..ce1bb81c93f 100644
--- a/src/vppinfra/vector_sse2.h
+++ b/src/vppinfra/vector_sse2.h
@@ -545,6 +545,31 @@ u32x4_is_zero (u32x4 x)
return u32x4_is_equal (x, zero);
}
+
+always_inline int
+u8x16_is_all_zero (u8x16 x)
+{
+ return _mm_testz_si128 ((__m128i) x, (__m128i) x);
+}
+
+always_inline int
+u16x8_is_all_zero (u16x8 x)
+{
+ return _mm_testz_si128 ((__m128i) x, (__m128i) x);
+}
+
+always_inline int
+u32x4_is_all_zero (u32x4 x)
+{
+ return _mm_testz_si128 ((__m128i) x, (__m128i) x);
+}
+
+always_inline int
+u64x2_is_all_zero (u64x2 x)
+{
+ return _mm_testz_si128 ((__m128i) x, (__m128i) x);
+}
+
#define u32x4_select(A,MASK) \
({ \
u32x4 _x, _y; \