aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vector_sse42.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-04-13 00:13:34 +0200
committerDamjan Marion <dmarion@me.com>2019-04-15 18:18:47 +0000
commitcf18ca92b86cc589cd482e951cba8a0a5eb5e0d5 (patch)
treea62f98abebfd0ec6ff7309fb1ce0d3e82ccb0b6b /src/vppinfra/vector_sse42.h
parent2a6861ff7bc90c1518b68459210830052774d429 (diff)
vppinfra: add SHA-2 family of hash algorithms (including HMAC)
Change-Id: I54d6fb1a2721b548620eb66cea254d0103deca32 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/vector_sse42.h')
-rw-r--r--src/vppinfra/vector_sse42.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vppinfra/vector_sse42.h b/src/vppinfra/vector_sse42.h
index a2d737a4892..0c1b2f0324f 100644
--- a/src/vppinfra/vector_sse42.h
+++ b/src/vppinfra/vector_sse42.h
@@ -617,6 +617,15 @@ u8x16_msb_mask (u8x16 v)
#undef _signed_binop
+static_always_inline u32x4
+u32x4_byte_swap (u32x4 v)
+{
+ u8x16 swap = {
+ 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
+ };
+ return (u32x4) _mm_shuffle_epi8 ((__m128i) v, (__m128i) swap);
+}
+
static_always_inline u16x8
u16x8_byte_swap (u16x8 v)
{