vppinfra: add ARM NEON implementation of u8x16_word_shift_{left,right}
[vpp.git] / src / vppinfra / vector_neon.h
index e0d0f06..307fbc5 100644 (file)
@@ -176,6 +176,24 @@ u32x4_scatter (u32x4 r, void *p0, void *p1, void *p2, void *p3)
   *(u32 *) p3 = vgetq_lane_u32 (r, 3);
 }
 
+static_always_inline u32
+u32x4_min_scalar (u32x4 v)
+{
+  return vminvq_u32 (v);
+}
+
+static_always_inline u8x16
+u8x16_word_shift_left (u8x16 x, const int n)
+{
+  return vextq_u8 (u8x16_splat (0), x, 16 - n);
+}
+
+static_always_inline u8x16
+u8x16_word_shift_right (u8x16 x, const int n)
+{
+  return vextq_u8 (x, u8x16_splat (0), n);
+}
+
 #define CLIB_HAVE_VEC128_MSB_MASK
 
 #define CLIB_HAVE_VEC128_UNALIGNED_LOAD_STORE