CNDP
22.08.0
|
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <cne_vect.h>
#include <cne_common.h>
Go to the source code of this file.
Macros | |
#define | MOVEUNALIGNED_LEFT47_IMM(dst, src, len, offset) |
#define | MOVEUNALIGNED_LEFT47(dst, src, len, offset) |
Functions | |
static __cne_always_inline void | cne_mov16 (uint8_t *dst, const uint8_t *src) |
static __cne_always_inline void | cne_mov32 (uint8_t *dst, const uint8_t *src) |
static __cne_always_inline void | cne_mov64 (uint8_t *dst, const uint8_t *src) |
static __cne_always_inline void | cne_mov128 (uint8_t *dst, const uint8_t *src) |
static __cne_always_inline void | cne_mov256 (uint8_t *dst, const uint8_t *src) |
static __cne_always_inline void * | cne_pktcpy (void *dst, const void *src, size_t n) |
static __cne_always_inline void * | cne_pktcpy_generic (void *dst, const void *src, size_t n) |
static __cne_always_inline void * | cne_pktcpy_aligned (void *dst, const void *src, size_t n) |
Functions for SSE/AVX/AVX2/AVX512 implementation of memcpy() suitable for copying large packets.
Definition in file cne_pktcpy.h.
#define MOVEUNALIGNED_LEFT47_IMM | ( | dst, | |
src, | |||
len, | |||
offset | |||
) |
Macro for copying unaligned block from one location to another with constant load offset, 47 bytes leftover maximum, locations should not overlap. Requirements:
offset
, which must be immediate value within [1, 15]src
, make sure offset
bit backwards & <16 - offset> bit forwards are available for loadingdst
, src
, len
must be variablesDefinition at line 647 of file cne_pktcpy.h.
#define MOVEUNALIGNED_LEFT47 | ( | dst, | |
src, | |||
len, | |||
offset | |||
) |
Macro for copying unaligned block from one location to another, 47 bytes leftover maximum, locations should not overlap. Use switch here because the aligning instruction requires immediate value for shift count. Requirements:
offset
, which must be within [1, 15]src
, make sure offset
bit backwards & <16 - offset> bit forwards are available for loadingdst
, src
, len
must be variablesDefinition at line 708 of file cne_pktcpy.h.
|
static |
Copy 16 bytes from one location to another using optimised instructions. The locations should not overlap.
dst | Pointer to the destination of the data. |
src | Pointer to the source data. |
SSE & AVX implementation below Copy 16 bytes from one location to another, locations should not overlap.
Definition at line 560 of file cne_pktcpy.h.
|
static |
Copy 32 bytes from one location to another using optimised instructions. The locations should not overlap.
dst | Pointer to the destination of the data. |
src | Pointer to the source data. |
Copy 32 bytes from one location to another, locations should not overlap.
Definition at line 573 of file cne_pktcpy.h.
|
static |
Copy 64 bytes from one location to another using optimised instructions. The locations should not overlap.
dst | Pointer to the destination of the data. |
src | Pointer to the source data. |
Copy 64 bytes from one location to another, locations should not overlap.
Definition at line 584 of file cne_pktcpy.h.
|
static |
Copy 128 bytes from one location to another using optimised instructions. The locations should not overlap.
dst | Pointer to the destination of the data. |
src | Pointer to the source data. |
Copy 128 bytes from one location to another, locations should not overlap.
Definition at line 597 of file cne_pktcpy.h.
|
static |
Copy 256 bytes from one location to another using optimised instructions. The locations should not overlap.
dst | Pointer to the destination of the data. |
src | Pointer to the source data. |
Copy 256 bytes from one location to another, locations should not overlap.
Definition at line 614 of file cne_pktcpy.h.
|
static |
Copy bytes from one location to another. The locations must not overlap.
dst | Pointer to the destination of the data. |
src | Pointer to the source data. |
n | Number of bytes to copy. |
Definition at line 962 of file cne_pktcpy.h.
|
static |
Generic packet copy routine for the given addresses and size.
The routine attempts to use AVX registers to copy the data.
dst | The memory address to copy the data too |
src | The memory address to copy the data from |
n | The number of bytes to copy |
Copy less than 16 bytes
Fast way when copy size doesn't exceed 512 bytes
Make store aligned when copy size exceeds 512 bytes, and make sure the first 15 bytes are copied, because unaligned copy functions require up to 15 bytes backwards access.
For aligned copy
Copy 256-byte blocks
Copy whatever left
For copy with unaligned load
Copy whatever left
Definition at line 746 of file cne_pktcpy.h.
|
static |
Generic packet copy routine of aligned data for the given addresses and size.
The routine attempts to use AVX registers to copy the data.
dst | The memory address to copy the data too |
src | The memory address to copy the data from |
n | The number of bytes to copy |
Definition at line 905 of file cne_pktcpy.h.