#include <stdint.h>
#include <emmintrin.h>
#include <derive-c/core/math.h>
#include <derive-c/core/prelude.h>
Go to the source code of this file.
◆ _DC_SWISS_BITMASK_FOR_EACH
| #define _DC_SWISS_BITMASK_FOR_EACH |
( |
| mask, |
|
|
| idx_var ) |
Value:
_once = 1; \
_once; _once = 0)
uint16_t _dc_swiss_ctrl_group_offset
static DC_INTERNAL _dc_swiss_ctrl_group_offset _dc_swiss_ctrl_group_bitmask_lowest(_dc_swiss_ctrl_group_bitmask mask)
static DC_INTERNAL _dc_swiss_ctrl_group_bitmask _dc_swiss_ctrl_group_bitmask_clear_lowest(_dc_swiss_ctrl_group_bitmask mask)
uint16_t _dc_swiss_ctrl_group_bitmask
Definition at line 129 of file utils.h.
129#define _DC_SWISS_BITMASK_FOR_EACH(mask, idx_var) \
130 for (_dc_swiss_ctrl_group_bitmask _m = (mask); _m != 0; \
131 _m = _dc_swiss_ctrl_group_bitmask_clear_lowest(_m)) \
132 for (_dc_swiss_ctrl_group_offset idx_var = _dc_swiss_ctrl_group_bitmask_lowest(_m), \
133 _once = 1; \
134 _once; _once = 0)
◆ _DC_SWISS_NO_INDEX
| #define _DC_SWISS_NO_INDEX ((size_t)-1) |
◆ _DC_SWISS_SIMD_PROBE_SIZE
◆ DC_SWISS_INITIAL_CAPACITY
| #define DC_SWISS_INITIAL_CAPACITY 256 |
◆ DC_SWISS_VAL_DELETED
| #define DC_SWISS_VAL_DELETED 0b11111110 |
◆ DC_SWISS_VAL_EMPTY
| #define DC_SWISS_VAL_EMPTY 0b10000000 |
◆ DC_SWISS_VAL_SENTINEL
| #define DC_SWISS_VAL_SENTINEL 0b11111111 |
◆ _dc_swiss_ctrl
◆ _dc_swiss_ctrl_group
◆ _dc_swiss_ctrl_group_bitmask
◆ _dc_swiss_ctrl_group_index
◆ _dc_swiss_ctrl_group_offset
◆ _dc_swiss_optional_index
◆ _dc_swiss_rehash_action
| Enumerator |
|---|
| DC_SWISS_DOUBLE_CAPACITY | |
| DC_SWISS_CLEANUP_TOMBSONES | |
| DC_SWISS_DO_NOTHING | |
Definition at line 75 of file utils.h.
75 {
@ DC_SWISS_DOUBLE_CAPACITY
@ DC_SWISS_CLEANUP_TOMBSONES
◆ _dc_swiss_ctrl_from_hash()
Definition at line 51 of file utils.h.
51 {
52
53 return (uint8_t)(hash >> (sizeof(size_t) * 8 - 7));
54}
◆ _dc_swiss_ctrl_group_bitmask_clear_lowest()
Definition at line 124 of file utils.h.
124 {
125 return mask & (mask - 1);
126}
◆ _dc_swiss_ctrl_group_bitmask_lowest()
Definition at line 118 of file utils.h.
118 {
121}
#define DC_ASSUME(expr,...)
◆ _dc_swiss_ctrl_set_at()
Definition at line 63 of file utils.h.
64 {
65
66
67
68
69 self[index] = val;
71 self[capacity + 1 + index] = val;
72 }
73}
#define _DC_SWISS_SIMD_PROBE_SIZE
◆ _dc_swiss_group_index_to_slot()
Definition at line 136 of file utils.h.
138 {
139 size_t pos = group_start + idx;
140 if (pos < capacity) {
141 return pos;
142 }
143 if (pos == capacity) {
144
146 }
147
148
149 return pos - capacity - 1;
150}
#define _DC_SWISS_NO_INDEX
◆ _dc_swiss_group_load()
Definition at line 106 of file utils.h.
106 {
107
108 return _mm_loadu_si128((const __m128i_u*)group_ptr);
109}
◆ _dc_swiss_group_match()
Definition at line 111 of file utils.h.
112 {
113 __m128i cmp = _mm_cmpeq_epi8(group, _mm_set1_epi8((char)value));
115}
◆ _dc_swiss_heuristic_should_extend()
Definition at line 82 of file utils.h.
82 {
84
85 const size_t max_load = capacity - (capacity / 8);
86
87 if (count + tombstones >= max_load) {
89 }
90
91 if (tombstones > (count / 2)) {
93 }
94
96}
◆ _dc_swiss_is_present()
Definition at line 40 of file utils.h.
40 {
41 switch (ctrl) {
45 return false;
46 default:
47 return true;
48 }
49}
#define DC_SWISS_VAL_EMPTY
#define DC_SWISS_VAL_DELETED
#define DC_SWISS_VAL_SENTINEL
◆ DC_STATIC_ASSERT()
◆ dc_swiss_capacity()
| DC_INTERNAL size_t dc_swiss_capacity |
( |
size_t | for_items | ) |
|
|
static |
Definition at line 56 of file utils.h.
56 {
59 }
61}
static DC_INLINE DC_CONST size_t dc_math_next_power_of_2(size_t x)
◆ _dc_swiss_index_capacity