summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vector_avx2.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-03-19 15:38:40 +0100
committerNeale Ranns <nranns@cisco.com>2019-03-26 10:31:01 +0000
commitc59b9a26ed9a6bc083db2868b6993add6fd2ba5b (patch)
tree70496bdc4ad01ab9e11cd07913f2aec681fac324 /src/vppinfra/vector_avx2.h
parent8e22054209ae9c4f08dae16f1aff910d8c8d0b76 (diff)
ipsec: esp-encrypt rework
Change-Id: Ibe7f806b9d600994e83c9f1be526fdb0a1ef1833 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/vector_avx2.h')
-rw-r--r--src/vppinfra/vector_avx2.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vppinfra/vector_avx2.h b/src/vppinfra/vector_avx2.h
index 51625618823..b9d6549da99 100644
--- a/src/vppinfra/vector_avx2.h
+++ b/src/vppinfra/vector_avx2.h
@@ -247,6 +247,19 @@ u32x8_scatter_one (u32x8 r, int index, void *p)
*(u32 *) p = r[index];
}
+static_always_inline u8x32
+u8x32_is_greater (u8x32 v1, u8x32 v2)
+{
+ return (u8x32) _mm256_cmpgt_epi8 ((__m256i) v1, (__m256i) v2);
+}
+
+static_always_inline u8x32
+u8x32_blend (u8x32 v1, u8x32 v2, u8x32 mask)
+{
+ return (u8x32) _mm256_blendv_epi8 ((__m256i) v1, (__m256i) v2,
+ (__m256i) mask);
+}
+
#endif /* included_vector_avx2_h */
/*