SWAR byte tests, the lane constants, the arguments, and the lane, mask and word dispatch tables. More...
Go to the source code of this file.
Data Structures | |
| struct | ScrutLaneCfg |
| Arguments for the lane calls. More... | |
| struct | ScrutMaskCfg |
| Arguments for the mask calls. More... | |
| struct | ScrutWordCfg |
| Arguments for the word calls. More... | |
| struct | ScrutLaneNs |
| Type of the lane dispatch table. More... | |
| struct | ScrutMaskNs |
| Type of the mask dispatch table. More... | |
| struct | ScrutWordNs |
| Type of the word dispatch table. More... | |
Macros | |
| #define | MMGR_SWAR_BYTES |
| Expands to sizeof(embed_word), and that is how many lanes one word carries. | |
| #define | MMGR_SWAR_LANE_BITS |
| Expands to EMBED_WORD_BITS, the width of a whole word in bits. | |
| #define | MMGR_SWAR_ONES |
| Expands to a word holding 1 in every lane, which is 0x0101...01. | |
| #define | MMGR_VERBUM_SCRUTOR_HIGH |
| Expands to a word holding 0x80 in every lane, which is 0x8080...80. | |
| #define | MMGR_SWAR_LOW7 |
| Expands to a word holding 0x7F in every lane, which is 0x7F7F...7F. | |
| #define | MMGR_SWAR_GO |
| Expands to 0, the first of three verdicts a scan step can report. | |
| #define | MMGR_SWAR_YES |
| Expands to 1, the second of the three verdicts described at MMGR_SWAR_GO. | |
| #define | MMGR_SWAR_NO |
| Expands to 2, the third of the three verdicts described at MMGR_SWAR_GO. | |
| #define | MMGR_FAM_CS |
| Expands to 0x60u, the two bits that separate the ASCII blocks a letter can fall in. | |
| #define | MMGR_FAM_CI |
| Expands to 0x40u, the value the MMGR_FAM_CS bits take across the 0x40 to 0x5F block. | |
Functions | |
| embed_word | mmgr_scrut_ge (const ScrutLaneCfg *args) |
| Marks the lanes of args->word that are at or above args->byte. | |
| 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_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_has_zero (const ScrutLaneCfg *args) |
| Marks the lanes of args->word that hold zero. | |
| embed_word | mmgr_scrut_eq (const ScrutLaneCfg *args) |
| Marks the lanes of args->word that equal args->byte. | |
| embed_word | mmgr_scrut_xor (const ScrutLaneCfg *args) |
| Returns the lane by lane difference of args->word and args->val. | |
| 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_upper (const ScrutLaneCfg *args) |
| Marks the lanes of args->word whose MMGR_FAM_CS bits equal MMGR_FAM_CI, the 0x40 to 0x5F block. | |
| 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_alpha (const ScrutLaneCfg *args) |
| Marks the lanes of args->word holding an ASCII letter, of either case. | |
| size_t | mmgr_scrut_lane_count (const ScrutLaneCfg *args) |
| Counts the set lanes of args->mask. | |
| size_t | mmgr_scrut_lane_lo (const ScrutLaneCfg *args) |
| Returns the index of the lowest set lane of args->mask. | |
| size_t | mmgr_scrut_lane_hi (const ScrutLaneCfg *args) |
| Returns the index of the highest set lane of args->mask. | |
| 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_drop_lo (const ScrutMaskCfg *args) |
| Clears the lowest set lane of args->mask. | |
| embed_word | mmgr_scrut_drop_hi (const ScrutMaskCfg *args) |
| Clears the highest set lane of args->mask. | |
| embed_word | mmgr_scrut_bytes_below (const ScrutMaskCfg *args) |
| Builds a mask covering the first args->bytes bytes of a word, in memory order. | |
| 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_lanes_before (const ScrutMaskCfg *args) |
| Returns the lanes that come before the first set lane of args->mask, in memory order. | |
| 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. | |
| 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_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_load (const ScrutWordCfg *args) |
| Loads one embed_word from args->at. | |
| embed_word | mmgr_scrut_load_al (const ScrutWordCfg *args) |
| Loads one embed_word from an aligned args->at. | |
| embed_word | mmgr_scrut_fold_lower (const ScrutWordCfg *args) |
| Returns args->word with every letter lane turned to lower case. | |
| size_t | mmgr_scrut_words (const ScrutWordCfg *args) |
| Returns how many whole words a scan of args->bytes bytes must read. | |
Variables | |
| static const ScrutLaneNs | lane |
| Dispatch table instance named lane. | |
| static const ScrutMaskNs | mask |
| Dispatch table instance named mask. | |
| static const ScrutWordNs | word |
| Dispatch table instance named word, with each member set to its mmgr_scrut_ function. | |
SWAR byte tests, the lane constants, the arguments, and the lane, mask and word dispatch tables.
Definition in file verbum_scrutor.h.
| #define MMGR_SWAR_BYTES |
Expands to sizeof(embed_word), and that is how many lanes one word carries.
Definition at line 33 of file verbum_scrutor.h.
| #define MMGR_SWAR_LANE_BITS |
Expands to EMBED_WORD_BITS, the width of a whole word in bits.
Definition at line 42 of file verbum_scrutor.h.
| #define MMGR_SWAR_ONES |
Expands to a word holding 1 in every lane, which is 0x0101...01.
Definition at line 50 of file verbum_scrutor.h.
| #define MMGR_VERBUM_SCRUTOR_HIGH |
Expands to a word holding 0x80 in every lane, which is 0x8080...80.
Definition at line 58 of file verbum_scrutor.h.
| #define MMGR_SWAR_LOW7 |
Expands to a word holding 0x7F in every lane, which is 0x7F7F...7F.
Definition at line 66 of file verbum_scrutor.h.
| #define MMGR_SWAR_GO |
Expands to 0, the first of three verdicts a scan step can report.
Definition at line 77 of file verbum_scrutor.h.
| #define MMGR_SWAR_YES |
Expands to 1, the second of the three verdicts described at MMGR_SWAR_GO.
Definition at line 80 of file verbum_scrutor.h.
| #define MMGR_SWAR_NO |
Expands to 2, the third of the three verdicts described at MMGR_SWAR_GO.
Definition at line 83 of file verbum_scrutor.h.
| #define MMGR_FAM_CS |
Expands to 0x60u, the two bits that separate the ASCII blocks a letter can fall in.
Definition at line 90 of file verbum_scrutor.h.
| #define MMGR_FAM_CI |
Expands to 0x40u, the value the MMGR_FAM_CS bits take across the 0x40 to 0x5F block.
Definition at line 97 of file verbum_scrutor.h.
| embed_word mmgr_scrut_ge | ( | const ScrutLaneCfg * | args | ) |
Marks the lanes of args->word that are at or above args->byte.
| [in] | args | The word and the byte to compare against [BORROWS]. |
References mmgr_scrut_ge().
Referenced by mmgr_scrut_ge().
| embed_word mmgr_scrut_le | ( | const ScrutLaneCfg * | args | ) |
Marks the lanes of args->word that are at or below args->byte.
| [in] | args | The word and the byte to compare against [BORROWS]. |
References mmgr_scrut_le().
Referenced by mmgr_scrut_le().
| 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.
| [in] | args | The word and the byte to subtract [BORROWS]. |
References mmgr_scrut_sub7().
Referenced by mmgr_scrut_sub7().
| embed_word mmgr_scrut_has_zero | ( | const ScrutLaneCfg * | args | ) |
Marks the lanes of args->word that hold zero.
| [in] | args | The word to test [BORROWS]. |
References mmgr_scrut_has_zero().
Referenced by mmgr_scrut_has_zero().
| embed_word mmgr_scrut_eq | ( | const ScrutLaneCfg * | args | ) |
Marks the lanes of args->word that equal args->byte.
| [in] | args | The word, the byte to find, and the case flag [BORROWS]. |
References mmgr_scrut_eq().
Referenced by mmgr_scrut_eq().
| embed_word mmgr_scrut_xor | ( | const ScrutLaneCfg * | args | ) |
Returns the lane by lane difference of args->word and args->val.
| [in] | args | The two words and the case flag [BORROWS]. |
References mmgr_scrut_xor().
Referenced by mmgr_scrut_xor().
| 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.
| [in] | args | The word, the byte to match, and the bits that count [BORROWS]. |
References mmgr_scrut_fam_eq().
Referenced by mmgr_scrut_fam_eq().
| 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.
| [in] | args | The word to test [BORROWS]. |
References mmgr_scrut_any_upper().
Referenced by mmgr_scrut_any_upper().
| embed_word mmgr_scrut_any_digit | ( | const ScrutLaneCfg * | args | ) |
Marks the lanes of args->word that fall in the 0x30 to 0x3F block.
| [in] | args | The word to test [BORROWS]. |
References mmgr_scrut_any_digit().
Referenced by mmgr_scrut_any_digit().
| embed_word mmgr_scrut_alpha | ( | const ScrutLaneCfg * | args | ) |
Marks the lanes of args->word holding an ASCII letter, of either case.
| [in] | args | The word to test [BORROWS]. |
References mmgr_scrut_alpha().
Referenced by mmgr_scrut_alpha().
| size_t mmgr_scrut_lane_count | ( | const ScrutLaneCfg * | args | ) |
Counts the set lanes of args->mask.
| [in] | args | The lane mask to count [BORROWS]. |
References mmgr_scrut_lane_count().
Referenced by mmgr_scrut_lane_count().
| size_t mmgr_scrut_lane_lo | ( | const ScrutLaneCfg * | args | ) |
Returns the index of the lowest set lane of args->mask.
| [in] | args | The lane mask to examine [BORROWS]. |
References mmgr_scrut_lane_lo().
Referenced by mmgr_scrut_lane_lo().
| size_t mmgr_scrut_lane_hi | ( | const ScrutLaneCfg * | args | ) |
Returns the index of the highest set lane of args->mask.
| [in] | args | The lane mask to examine [BORROWS]. |
References mmgr_scrut_lane_hi().
Referenced by mmgr_scrut_lane_hi().
| 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.
| [in] | args | The lane mask to widen [BORROWS]. |
References mmgr_scrut_spread().
Referenced by mmgr_scrut_spread().
| embed_word mmgr_scrut_drop_lo | ( | const ScrutMaskCfg * | args | ) |
Clears the lowest set lane of args->mask.
| [in] | args | The lane mask to reduce [BORROWS]. |
References mmgr_scrut_drop_lo().
Referenced by mmgr_scrut_drop_lo().
| embed_word mmgr_scrut_drop_hi | ( | const ScrutMaskCfg * | args | ) |
Clears the highest set lane of args->mask.
| [in] | args | The lane mask to reduce [BORROWS]. |
References mmgr_scrut_drop_hi().
Referenced by mmgr_scrut_drop_hi().
| embed_word mmgr_scrut_bytes_below | ( | const ScrutMaskCfg * | args | ) |
Builds a mask covering the first args->bytes bytes of a word, in memory order.
| [in] | args | The byte count to cover [BORROWS]. |
References mmgr_scrut_bytes_below().
Referenced by mmgr_scrut_bytes_below().
| 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.
| [in] | args | The lane count to cover [BORROWS]. |
References mmgr_scrut_lanes_below().
Referenced by mmgr_scrut_lanes_below().
| 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.
| [in] | args | The lane mask to examine [BORROWS]. |
References mmgr_scrut_lanes_before().
Referenced by mmgr_scrut_lanes_before().
| 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.
| [in] | args | The total byte count and the whole words already covered [BORROWS]. |
References mmgr_scrut_tail_mask().
Referenced by mmgr_scrut_tail_mask().
| embed_word mmgr_scrut_run | ( | const ScrutMaskCfg * | args | ) |
Marks the lanes of args->mask that begin a run of args->bytes set lanes.
| [in] | args | The lane mask and the run length wanted [BORROWS]. |
References mmgr_scrut_run().
Referenced by mmgr_scrut_run().
| 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.
| [in] | args | The run length wanted [BORROWS]. |
References mmgr_scrut_run_edge().
Referenced by mmgr_scrut_run_edge().
| embed_word mmgr_scrut_load | ( | const ScrutWordCfg * | args | ) |
Loads one embed_word from args->at.
| [in] | args | Address to load from [BORROWS]. |
References mmgr_scrut_load().
Referenced by mmgr_scrut_load().
| embed_word mmgr_scrut_load_al | ( | const ScrutWordCfg * | args | ) |
Loads one embed_word from an aligned args->at.
| [in] | args | Address to load from [BORROWS]. |
References mmgr_scrut_load_al().
Referenced by mmgr_scrut_load_al().
| embed_word mmgr_scrut_fold_lower | ( | const ScrutWordCfg * | args | ) |
Returns args->word with every letter lane turned to lower case.
| [in] | args | The word to fold [BORROWS]. |
References mmgr_scrut_fold_lower().
Referenced by mmgr_scrut_fold_lower().
| size_t mmgr_scrut_words | ( | const ScrutWordCfg * | args | ) |
Returns how many whole words a scan of args->bytes bytes must read.
| [in] | args | The byte count to convert [BORROWS]. |
References mmgr_scrut_words().
Referenced by mmgr_scrut_words().
|
static |
Dispatch table instance named lane.
Definition at line 490 of file verbum_scrutor.h.
|
static |
Dispatch table instance named mask.
Definition at line 518 of file verbum_scrutor.h.
|
static |
Dispatch table instance named word, with each member set to its mmgr_scrut_ function.
Definition at line 540 of file verbum_scrutor.h.