summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-05-19 00:04:23 +0200
committerDamjan Marion <damarion@cisco.com>2018-05-20 14:52:39 +0200
commita52e1668c9976bd5cdd20d02b668df41ea41f16f (patch)
tree75ed44c2df7a88e0e3af39ae1c4de4cc49f36ad7 /src/vnet/ip
parent3b854a5cb876b5af4e69c56028e2c2824100f4b2 (diff)
vector functions cleanup and improvements
Remove functions which have native C equivalent (i.e. _is_equal can be replaced with ==, _add with +) Add SSE4.2, AVX-512 implementations of splat, load_unaligned, store_unaligned, is_all_zero, is_equal, is_all_equal Change-Id: Ie80b0e482e7a76248ad79399c2576468532354cd Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip4_source_and_port_range_check.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/vnet/ip/ip4_source_and_port_range_check.c b/src/vnet/ip/ip4_source_and_port_range_check.c
index 06e6e7c6b63..2889a899678 100644
--- a/src/vnet/ip/ip4_source_and_port_range_check.c
+++ b/src/vnet/ip/ip4_source_and_port_range_check.c
@@ -133,9 +133,8 @@ check_adj_port_range_x1 (const protocol_port_range_dpo_t * ppr_dpo,
u16x8_sub_saturate (ppr_dpo->blocks[i].low.as_u16x8, key.as_u16x8);
diff2.as_u16x8 =
u16x8_sub_saturate (ppr_dpo->blocks[i].hi.as_u16x8, key.as_u16x8);
- sum.as_u16x8 = u16x8_add (diff1.as_u16x8, diff2.as_u16x8);
- sum_equal_diff2.as_u16x8 =
- u16x8_is_equal (sum.as_u16x8, diff2.as_u16x8);
+ sum.as_u16x8 = diff1.as_u16x8 + diff2.as_u16x8;
+ sum_equal_diff2.as_u16x8 = (sum.as_u16x8 == diff2.as_u16x8);
sum_nonzero = ~u16x8_zero_byte_mask (sum.as_u16x8);
sum_equal = ~u16x8_zero_byte_mask (sum_equal_diff2.as_u16x8);
winner_mask = sum_nonzero & sum_equal;