NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
rte_memory.h File Reference
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <x86intrin.h>
Include dependency graph for rte_memory.h:

Macros

#define ALIGNMENT_MASK   0x0F
 
#define MOVEUNALIGNED_LEFT47_IMM(dst, src, len, offset)
 
#define MOVEUNALIGNED_LEFT47(dst, src, len, offset)
 

Detailed Description

Functions for SSE/AVX/AVX2/AVX512 implementation of memcpy().

Macro Definition Documentation

◆ ALIGNMENT_MASK

#define ALIGNMENT_MASK   0x0F

◆ MOVEUNALIGNED_LEFT47

#define MOVEUNALIGNED_LEFT47 (   dst,
  src,
  len,
  offset 
)
Value:
__extension__({ \
switch (offset) { \
case 0x01: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x01); break; \
case 0x02: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x02); break; \
case 0x03: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x03); break; \
case 0x04: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x04); break; \
case 0x05: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x05); break; \
case 0x06: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x06); break; \
case 0x07: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x07); break; \
case 0x08: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x08); break; \
case 0x09: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x09); break; \
case 0x0A: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0A); break; \
case 0x0B: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0B); break; \
case 0x0C: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0C); break; \
case 0x0D: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0D); break; \
case 0x0E: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0E); break; \
case 0x0F: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0F); break; \
default:; \
} \
})

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:

  • Store is aligned
  • Load offset is <offset>, which must be within [1, 15]
  • For <src>, make sure <offset> bit backwards & <16 - offset> bit forwards are available for loading
  • <dst>, <src>, <len> must be variables
  • __m128i <xmm0> ~ <xmm8> used in MOVEUNALIGNED_LEFT47_IMM must be pre-defined

◆ MOVEUNALIGNED_LEFT47_IMM

#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:

  • Store is aligned
  • Load offset is <offset>, which must be immediate value within [1, 15]
  • For <src>, make sure <offset> bit backwards & <16 - offset> bit forwards are available for loading
  • <dst>, <src>, <len> must be variables
  • __m128i <xmm0> ~ <xmm8> must be pre-defined