aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSirshak Das <sirshak.das@arm.com>2018-07-27 01:13:33 -0500
committerDamjan Marion <dmarion@me.com>2018-08-01 10:52:56 +0000
commitafc725afaed47f90f48f148c5c8f74348e0aaf23 (patch)
tree87009bbf214cac01e66034694bed1a54a945733f
parent1c7bf5d41737984907e8bad1dc832eb6cb1d6288 (diff)
Add support for shuffle vector intrinsic via Neon in ARM
This adds byte_swap (variant of shuffle) and shuffle vector intrinsic for ARM based on Neon, concuring with same signature as SSE vector intrinsic. Change-Id: I386fd2b1dcc83654e4ad9f90a6065d7736e4ce5c Signed-off-by: Sirshak Das <sirshak.das@arm.com>
-rw-r--r--src/vppinfra/vector_neon.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vppinfra/vector_neon.h b/src/vppinfra/vector_neon.h
index 7ca3c2c4221..451c531d52d 100644
--- a/src/vppinfra/vector_neon.h
+++ b/src/vppinfra/vector_neon.h
@@ -118,6 +118,22 @@ foreach_neon_vec128i foreach_neon_vec128u
#undef _
/* *INDENT-ON* */
+static_always_inline u16x8
+u16x8_byte_swap (u16x8 v)
+{
+ const u8 swap_pattern[] = {
+ 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14,
+ };
+ u8x16 swap = vld1q_u8 (swap_pattern);
+ return (u16x8) vqtbl1q_u8 ((u8x16) v, swap);
+}
+
+static_always_inline u8x16
+u8x16_shuffle (u8x16 v, u8x16 m)
+{
+ return (u8x16) vqtbl1q_u8 (v, m);
+}
+
#define CLIB_HAVE_VEC128_UNALIGNED_LOAD_STORE
#define CLIB_VEC128_SPLAT_DEFINED
#endif /* included_vector_neon_h */