aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-11-10 20:20:32 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-10 20:21:22 +0000
commitb79d886ff411e402818e0d172d7c3facd1da00d8 (patch)
treeca6e43df418d74bf1c60b2d60438442b195d7644
parent890955866f5953727a782363cf3ece051ae7d4c5 (diff)
vppinfra: add 512-bit vector definitions and types
Change-Id: I245c034684ba8585c8f5bb5353027aba13f8a53e Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--src/vppinfra/vector.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/vppinfra/vector.h b/src/vppinfra/vector.h
index 491e7cfe547..5da1c19037b 100644
--- a/src/vppinfra/vector.h
+++ b/src/vppinfra/vector.h
@@ -54,6 +54,14 @@
#define CLIB_HAVE_VEC128
#endif
+#if defined (__AVX__)
+#define CLIB_HAVE_VEC256
+#endif
+
+#if defined (__AVX512F__)
+#define CLIB_HAVE_VEC512
+#endif
+
/* 128 implies 64 */
#ifdef CLIB_HAVE_VEC128
#define CLIB_HAVE_VEC64
@@ -116,6 +124,23 @@ typedef f32 f32x8 _vector_size (32);
typedef f64 f64x4 _vector_size (32);
#endif /* CLIB_HAVE_VEC128 */
+#ifdef CLIB_HAVE_VEC512
+/* Signed 512 bit. */
+typedef i8 i8x64 _vector_size (64);
+typedef i16 i16x32 _vector_size (64);
+typedef i32 i32x16 _vector_size (64);
+typedef long long i64x8 _vector_size (64);
+
+/* Unsigned 512 bit. */
+typedef u8 u8x64 _vector_size (64);
+typedef u16 u16x32 _vector_size (64);
+typedef u32 u32x16 _vector_size (64);
+typedef u64 u64x8 _vector_size (64);
+
+typedef f32 f32x16 _vector_size (64);
+typedef f64 f64x8 _vector_size (64);
+#endif /* CLIB_HAVE_VEC512 */
+
/* Vector word sized types. */
#ifndef CLIB_VECTOR_WORD_BITS
#ifdef CLIB_HAVE_VEC128