18#ifndef MMGR_VERBUM_SCRUTOR_H
19#define MMGR_VERBUM_SCRUTOR_H
33#define MMGR_SWAR_BYTES (sizeof(embed_word))
42#define MMGR_SWAR_LANE_BITS (EMBED_WORD_BITS)
50#define MMGR_SWAR_ONES (((embed_word) ~(embed_word)0) / 0xFFu)
58#define MMGR_VERBUM_SCRUTOR_HIGH (MMGR_SWAR_ONES * 0x80u)
66#define MMGR_SWAR_LOW7 (MMGR_SWAR_ONES * 0x7Fu)
80#define MMGR_SWAR_YES 1
90#define MMGR_FAM_CS 0x60u
97#define MMGR_FAM_CI 0x40u
138 const void *
const at;
168EMBED_TABLE_LAYOUT(
ScrutLaneNs, ge, le, sub7, has_zero, eq, xor_, fam_eq, any_upper, any_digit, alpha, count, first,
190EMBED_TABLE_LAYOUT(
ScrutMaskNs, spread, drop_first, drop_last, bytes_below, lanes_below, before, tail, run, run_edge);
206EMBED_TABLE_LAYOUT(
ScrutWordNs, load, load_al, fold_lower, count);
502#if MMGR_HW_BIG_ENDIAN
520#if MMGR_HW_BIG_ENDIAN
The embedded_types headers every module builds on.
Typed loads and stores, and the proxim dispatch table.
Arguments for the lane calls.
Type of the lane dispatch table.
embed_word(*) has_zero(const ScrutLaneCfg *args)
embed_word(*) any_upper(const ScrutLaneCfg *args)
embed_word(*) alpha(const ScrutLaneCfg *args)
embed_word(*) sub7(const ScrutLaneCfg *args)
embed_word(*) le(const ScrutLaneCfg *args)
size_t(*) count(const ScrutLaneCfg *args)
embed_word(*) any_digit(const ScrutLaneCfg *args)
embed_word(*) eq(const ScrutLaneCfg *args)
size_t(*) first(const ScrutLaneCfg *args)
size_t(*) last(const ScrutLaneCfg *args)
embed_word(*) xor_(const ScrutLaneCfg *args)
embed_word(*) ge(const ScrutLaneCfg *args)
embed_word(*) fam_eq(const ScrutLaneCfg *args)
Arguments for the mask calls.
Type of the mask dispatch table.
embed_word(*) bytes_below(const ScrutMaskCfg *args)
embed_word(*) lanes_below(const ScrutMaskCfg *args)
embed_word(*) drop_last(const ScrutMaskCfg *args)
embed_word(*) spread(const ScrutMaskCfg *args)
embed_word(*) run_edge(const ScrutMaskCfg *args)
embed_word(*) tail(const ScrutMaskCfg *args)
embed_word(*) drop_first(const ScrutMaskCfg *args)
embed_word(*) before(const ScrutMaskCfg *args)
embed_word(*) run(const ScrutMaskCfg *args)
Arguments for the word calls.
Type of the word dispatch table.
size_t(*) count(const ScrutWordCfg *args)
embed_word(*) load(const ScrutWordCfg *args)
embed_word(*) fold_lower(const ScrutWordCfg *args)
embed_word(*) load_al(const ScrutWordCfg *args)
embed_word mmgr_scrut_fam_eq(const ScrutLaneCfg *args)
Marks the lanes of args->word that match args->byte once both are reduced to the args->fam bits.
embed_word mmgr_scrut_any_digit(const ScrutLaneCfg *args)
Marks the lanes of args->word that fall in the 0x30 to 0x3F block.
embed_word mmgr_scrut_spread(const ScrutMaskCfg *args)
Widens every set lane of args->mask from its high bit to a full byte of ones.
embed_word mmgr_scrut_has_zero(const ScrutLaneCfg *args)
Marks the lanes of args->word that hold zero.
embed_word mmgr_scrut_drop_hi(const ScrutMaskCfg *args)
Clears the highest set lane of args->mask.
size_t mmgr_scrut_lane_count(const ScrutLaneCfg *args)
Counts the set lanes of args->mask.
embed_word mmgr_scrut_sub7(const ScrutLaneCfg *args)
Subtracts args->byte from every lane of args->word and keeps the low seven bits of each result.
embed_word mmgr_scrut_any_upper(const ScrutLaneCfg *args)
Marks the lanes of args->word whose MMGR_FAM_CS bits equal MMGR_FAM_CI, the 0x40 to 0x5F block.
size_t mmgr_scrut_lane_hi(const ScrutLaneCfg *args)
Returns the index of the highest set lane of args->mask.
embed_word mmgr_scrut_ge(const ScrutLaneCfg *args)
Marks the lanes of args->word that are at or above args->byte.
static const ScrutWordNs word
Dispatch table instance named word, with each member set to its mmgr_scrut_ function.
embed_word mmgr_scrut_lanes_before(const ScrutMaskCfg *args)
Returns the lanes that come before the first set lane of args->mask, in memory order.
static const ScrutLaneNs lane
Dispatch table instance named lane.
embed_word mmgr_scrut_drop_lo(const ScrutMaskCfg *args)
Clears the lowest set lane of args->mask.
static const ScrutMaskNs mask
Dispatch table instance named mask.
embed_word mmgr_scrut_run_edge(const ScrutMaskCfg *args)
Marks the lanes too near the end of a word for a run of args->bytes to fit inside it.
embed_word mmgr_scrut_le(const ScrutLaneCfg *args)
Marks the lanes of args->word that are at or below args->byte.
embed_word mmgr_scrut_bytes_below(const ScrutMaskCfg *args)
Builds a mask covering the first args->bytes bytes of a word, in memory order.
size_t mmgr_scrut_words(const ScrutWordCfg *args)
Returns how many whole words a scan of args->bytes bytes must read.
size_t mmgr_scrut_lane_lo(const ScrutLaneCfg *args)
Returns the index of the lowest set lane of args->mask.
embed_word mmgr_scrut_xor(const ScrutLaneCfg *args)
Returns the lane by lane difference of args->word and args->val.
embed_word mmgr_scrut_load(const ScrutWordCfg *args)
Loads one embed_word from args->at.
embed_word mmgr_scrut_lanes_below(const ScrutMaskCfg *args)
Builds a lane mask covering the first args->bytes lanes of a word, in memory order.
embed_word mmgr_scrut_alpha(const ScrutLaneCfg *args)
Marks the lanes of args->word holding an ASCII letter, of either case.
embed_word mmgr_scrut_load_al(const ScrutWordCfg *args)
Loads one embed_word from an aligned args->at.
embed_word mmgr_scrut_eq(const ScrutLaneCfg *args)
Marks the lanes of args->word that equal args->byte.
embed_word mmgr_scrut_run(const ScrutMaskCfg *args)
Marks the lanes of args->mask that begin a run of args->bytes set lanes.
embed_word mmgr_scrut_fold_lower(const ScrutWordCfg *args)
Returns args->word with every letter lane turned to lower case.
embed_word mmgr_scrut_tail_mask(const ScrutMaskCfg *args)
Builds the lane mask for the last partial word of a scan of args->bytes bytes.