aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-07-16 19:19:29 +0200
committerFlorin Coras <florin.coras@gmail.com>2020-07-23 17:20:01 +0000
commit5c00ec26ecdb5b5d303e4215a2b6b2d0c93ee37e (patch)
tree6666eb2935daebb3ee936654d0b084d0a8692af8 /src
parent1caf7f11c0197a912ccc28e67e4e9af75323af80 (diff)
vppinfra: add *_zero() vector inlines
Type: improvement Change-Id: Ia63d1d7de273967ab7725d83634c0b6dd481c6c0 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vppinfra/vector.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vppinfra/vector.h b/src/vppinfra/vector.h
index 8b08db22124..33e2b6a8773 100644
--- a/src/vppinfra/vector.h
+++ b/src/vppinfra/vector.h
@@ -155,6 +155,15 @@ typedef u32 u32x _vector_size (8);
typedef u64 u64x _vector_size (8);
#endif
+/* universal inlines */
+#define _(t, s, c) \
+static_always_inline t##s##x##c \
+t##s##x##c##_zero () \
+{ return (t##s##x##c) {}; } \
+
+foreach_vec
+#undef _
+
#undef _vector_size
#define VECTOR_WORD_TYPE(t) t##x