From 107aa83630a1943018a4f96eb235ba8981748568 Mon Sep 17 00:00:00 2001 From: "Lijian.Zhang" Date: Wed, 29 May 2019 17:08:47 +0800 Subject: vppinfra: add u64x2_gather/u32x4_gather Add u64x2_gather/u32x4_gather in vector_neon.h. u64x2_gather/u32x4_gather gathers data from scattered memory locations to a SIMD register. Type: feature Change-Id: I1dd27e38af28b9bed85143014c86197ee549fede Signed-off-by: Lijian Zhang Reviewed-by: Sirshak Das Reviewed-by: Honnappa Nagarahalli --- src/vppinfra/vector_neon.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/vppinfra') diff --git a/src/vppinfra/vector_neon.h b/src/vppinfra/vector_neon.h index 37bd1bb0b01..4e911ac678a 100644 --- a/src/vppinfra/vector_neon.h +++ b/src/vppinfra/vector_neon.h @@ -142,6 +142,24 @@ u8x16_msb_mask (u8x16 v) return (u16) (vgetq_lane_u64 (x64, 0) + (vgetq_lane_u64 (x64, 1) << 8)); } +static_always_inline u64x2 +u64x2_gather (void *p0, void *p1) +{ + u64x2 r = vdupq_n_u64 (*(u64 *) p0); + r = vsetq_lane_u64 (*(u64 *) p1, r, 1); + return r; +} + +static_always_inline u32x4 +u32x4_gather (void *p0, void *p1, void *p2, void *p3) +{ + u32x4 r = vdupq_n_u32 (*(u32 *) p0); + r = vsetq_lane_u32 (*(u32 *) p1, r, 1); + r = vsetq_lane_u32 (*(u32 *) p2, r, 2); + r = vsetq_lane_u32 (*(u32 *) p3, r, 3); + return r; +} + #define CLIB_HAVE_VEC128_MSB_MASK #define CLIB_HAVE_VEC128_UNALIGNED_LOAD_STORE -- cgit 1.2.3-korg