aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vector_sse2.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-02-19 12:14:06 +0100
committerFlorin Coras <florin.coras@gmail.com>2018-02-19 20:14:30 +0000
commitc6969b55e40613479183141c01f057f9253f17a8 (patch)
tree0c2eea7ee2ede18e81255f42e00b62ad8540da43 /src/vppinfra/vector_sse2.h
parent829ee5399504478901be245914333fdf704131c2 (diff)
Use neutral vector code for ethernet_frame_is_tagged
Also it removes ethernet_frame_is_any_taged implemebntation which seems to be equally costly compared to two invocations of ethernet_frame_is_tagged. Change-Id: If1c95f8267cd34b807ec07e0d675cbd0db2fdf9f Signed-off-by: Damjan Marion <damarion@cisco.com>
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; \