Lines Matching defs:bitset

32 #include "util/bitset.h"
44 * The set of leaf node bitsets in the bitset hiearchy which defines all
55 * Decode scope. When parsing a field that is itself a bitset, we push a
56 * new scope to the stack. A nested bitset is allowed to resolve fields
58 * bitsets, where half/fullness is determined by fields outset if bitset
59 * in the instruction containing the bitset.
78 * Current bitset value being decoded
83 * Current bitset.
85 const struct isa_bitset *bitset;
251 push_scope(struct decode_state *state, const struct isa_bitset *bitset, bitmask_t val)
255 BITSET_COPY(scope->val.bitset, val.bitset);
256 scope->bitset = bitset;
304 * Find the bitset in NULL terminated bitset hiearchy root table which
322 BITSET_AND(m.bitset, val.bitset, bitsets[n]->mask.bitset);
324 BITSET_COPY(not_dontcare.bitset, bitsets[n]->dontcare.bitset);
325 BITSET_NOT(not_dontcare.bitset);
327 BITSET_AND(m.bitset, m.bitset, not_dontcare.bitset);
329 if (!BITSET_EQUAL(m.bitset, bitsets[n]->match.bitset)) {
339 decode_error(state, "bitset conflict: %s vs %s", match->name,
349 BITSET_AND(m.bitset, match->dontcare.bitset, val.bitset);
351 if (BITSET_COUNT(m.bitset)) {
353 match->name, BITSET_VALUE(m.bitset));
361 find_field(struct decode_scope *scope, const struct isa_bitset *bitset,
364 for (unsigned i = 0; i < bitset->num_cases; i++) {
365 const struct isa_case *c = bitset->cases[i];
390 if (bitset->parent) {
391 const struct isa_field *f = find_field(scope, bitset->parent, name, name_len);
405 BITSET_COPY(val.bitset, scope->val.bitset);
406 BITSET_ZERO(mask.bitset);
408 BITSET_SET_RANGE(mask.bitset, field->low, field->high);
409 BITSET_AND(val.bitset, val.bitset, mask.bitset);
410 BITSET_SHR(val.bitset, field->low);
416 * Find the display template for a given bitset, recursively searching
417 * parents in the bitset hierarchy.
420 find_display(struct decode_scope *scope, const struct isa_bitset *bitset)
422 for (unsigned i = 0; i < bitset->num_cases; i++) {
423 const struct isa_case *c = bitset->cases[i];
435 if (!BITSET_EQUAL(val.bitset, f->val.bitset)) {
438 f->low, f->high, bitset->name,
439 BITSET_VALUE(val.bitset), BITSET_VALUE(f->val.bitset));
449 * If we didn't find something check up the bitset hierarchy.
451 if (bitset->parent) {
452 return find_display(scope, bitset->parent);
459 * Decode a field that is itself another bitset type
467 scope->bitset->name, field->name, BITSET_VALUE(val.bitset));
503 find_field(scope, scope->bitset, field_name, field_name_len);
571 /* Special case 'NAME' maps to instruction/bitset name: */
575 .str = scope->bitset->name,
582 print(scope->state, "%s", scope->bitset->name);
665 /* For fields that are decoded with another bitset hierarchy: */
678 const struct isa_bitset *bitset = scope->bitset;
679 const char *display = find_display(scope, bitset);
682 decode_error(scope->state, "%s: no display template", bitset->name);
730 state->n, instr.bitset);
736 state->options->instr_cb(state->options->cbdata, state->n, instr.bitset);
741 print(state, "no match: %"BITSET_FORMAT"\n", BITSET_VALUE(instr.bitset));