diff options
author | Damjan Marion <damarion@cisco.com> | 2020-08-31 17:18:26 +0200 |
---|---|---|
committer | Matthew Smith <mgsmith@netgate.com> | 2020-08-31 18:46:21 +0000 |
commit | 90d05bc7fb834b5cf25bdd9bb6d92bb35e602494 (patch) | |
tree | e1de27a272922a18677918dbc95f902a3ddb5b20 /src/vnet/ip | |
parent | f9c8fe41280a48f95216cab43eab8db00ee592e1 (diff) |
vppinfra: convert A_extend_to_B to B_from_A format of vector inlines
Make it shorter and same format when converting to biggor or smaller
types.
Type: refactor
Change-Id: I443d67e18ae65d779b4d9a0dce5406f7d9f0e4ac
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r-- | src/vnet/ip/ip_packet.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vnet/ip/ip_packet.h b/src/vnet/ip/ip_packet.h index e67cec1512f..52a65e78c24 100644 --- a/src/vnet/ip/ip_packet.h +++ b/src/vnet/ip/ip_packet.h @@ -176,10 +176,10 @@ ip_csum (void *data, u16 n_left) v1 = u16x16_byte_swap (v1); v2 = u16x16_byte_swap (v2); #endif - sum8 += u16x8_extend_to_u32x8 (u16x16_extract_lo (v1)); - sum8 += u16x8_extend_to_u32x8 (u16x16_extract_hi (v1)); - sum8 += u16x8_extend_to_u32x8 (u16x16_extract_lo (v2)); - sum8 += u16x8_extend_to_u32x8 (u16x16_extract_hi (v2)); + sum8 += u32x8_from_u16x8 (u16x16_extract_lo (v1)); + sum8 += u32x8_from_u16x8 (u16x16_extract_hi (v1)); + sum8 += u32x8_from_u16x8 (u16x16_extract_lo (v2)); + sum8 += u32x8_from_u16x8 (u16x16_extract_hi (v2)); n_left -= 32; data += 64; } @@ -191,8 +191,8 @@ ip_csum (void *data, u16 n_left) v1 = u16x16_byte_swap (v1); #endif v1 = u16x16_byte_swap (u16x16_load_unaligned (data)); - sum8 += u16x8_extend_to_u32x8 (u16x16_extract_lo (v1)); - sum8 += u16x8_extend_to_u32x8 (u16x16_extract_hi (v1)); + sum8 += u32x8_from_u16x8 (u16x16_extract_lo (v1)); + sum8 += u32x8_from_u16x8 (u16x16_extract_hi (v1)); n_left -= 16; data += 32; } @@ -204,8 +204,8 @@ ip_csum (void *data, u16 n_left) v1 = u16x16_byte_swap (v1); #endif v1 = u16x16_mask_last (v1, 16 - n_left); - sum8 += u16x8_extend_to_u32x8 (u16x16_extract_lo (v1)); - sum8 += u16x8_extend_to_u32x8 (u16x16_extract_hi (v1)); + sum8 += u32x8_from_u16x8 (u16x16_extract_lo (v1)); + sum8 += u32x8_from_u16x8 (u16x16_extract_hi (v1)); } sum8 = u32x8_hadd (sum8, zero); |