Lines Matching full:bitset
36 #include "util/bitset.h"
47 * The set of leaf node bitsets in the bitset hiearchy which defines all
58 * Decode scope. When parsing a field that is itself a bitset, we push a
59 * new scope to the stack. A nested bitset is allowed to resolve fields
61 * bitsets, where half/fullness is determined by fields outset if bitset
62 * in the instruction containing the bitset.
81 * Current bitset value being decoded
86 * Current bitset.
88 const struct isa_bitset *bitset; member
135 * Bitset of instructions that are branch targets (if options->branch_labels
141 * Bitset of instructions that are call targets.
146 * Bitset of instructions that are entrypoints.
266 push_scope(struct decode_state *state, const struct isa_bitset *bitset, bitmask_t val) in push_scope() argument
270 BITSET_COPY(scope->val.bitset, val.bitset); in push_scope()
271 scope->bitset = bitset; in push_scope()
319 * Find the bitset in NULL terminated bitset hiearchy root table which
337 BITSET_AND(m.bitset, val.bitset, bitsets[n]->mask.bitset); in find_bitset()
339 BITSET_COPY(not_dontcare.bitset, bitsets[n]->dontcare.bitset); in find_bitset()
340 BITSET_NOT(not_dontcare.bitset); in find_bitset()
342 BITSET_AND(m.bitset, m.bitset, not_dontcare.bitset); in find_bitset()
344 if (!BITSET_EQUAL(m.bitset, bitsets[n]->match.bitset)) { in find_bitset()
354 decode_error(state, "bitset conflict: %s vs %s", match->name, in find_bitset()
364 BITSET_AND(m.bitset, match->dontcare.bitset, val.bitset); in find_bitset()
366 if (BITSET_COUNT(m.bitset)) { in find_bitset()
368 match->name, BITSET_VALUE(m.bitset)); in find_bitset()
376 find_field(struct decode_scope *scope, const struct isa_bitset *bitset, in find_field() argument
379 for (unsigned i = 0; i < bitset->num_cases; i++) { in find_field()
380 const struct isa_case *c = bitset->cases[i]; in find_field()
405 if (bitset->parent) { in find_field()
406 const struct isa_field *f = find_field(scope, bitset->parent, name, name_len); in find_field()
420 BITSET_COPY(val.bitset, scope->val.bitset); in extract_field()
421 BITSET_ZERO(mask.bitset); in extract_field()
423 BITSET_SET_RANGE(mask.bitset, field->low, field->high); in extract_field()
424 BITSET_AND(val.bitset, val.bitset, mask.bitset); in extract_field()
425 BITSET_SHR(val.bitset, field->low); in extract_field()
431 * Find the display template for a given bitset, recursively searching
432 * parents in the bitset hierarchy.
435 find_display(struct decode_scope *scope, const struct isa_bitset *bitset) in find_display() argument
437 for (unsigned i = 0; i < bitset->num_cases; i++) { in find_display()
438 const struct isa_case *c = bitset->cases[i]; in find_display()
450 if (!BITSET_EQUAL(val.bitset, f->val.bitset)) { in find_display()
453 f->low, f->high, bitset->name, in find_display()
454 BITSET_VALUE(val.bitset), BITSET_VALUE(f->val.bitset)); in find_display()
464 * If we didn't find something check up the bitset hierarchy. in find_display()
466 if (bitset->parent) { in find_display()
467 return find_display(scope, bitset->parent); in find_display()
474 * Decode a field that is itself another bitset type
482 scope->bitset->name, field->name, BITSET_VALUE(val.bitset)); in display_bitset_field()
518 find_field(scope, scope->bitset, field_name, field_name_len); in resolve_field()
593 /* Special case 'NAME' maps to instruction/bitset name: */ in display_field()
597 .str = scope->bitset->name, in display_field()
604 isa_print(print, "%s", scope->bitset->name); in display_field()
716 /* For fields that are decoded with another bitset hierarchy: */ in display_field()
729 const struct isa_bitset *bitset = scope->bitset; in display() local
730 const char *display = find_display(scope, bitset); in display()
733 decode_error(scope->state, "%s: no display template", bitset->name); in display()
789 state->n, instr.bitset); in disasm()
798 state->n, instr.bitset); in disasm()
807 state->n, instr.bitset); in disasm()
815 state->n, instr.bitset); in disasm()
822 state->options->pre_instr_cb(state->options->cbdata, state->n, instr.bitset); in disasm()
828 state->options->no_match_cb(state->print.out, instr.bitset, BITMASK_WORDS); in disasm()
830 isa_print(&state->print, "no match: %"BITSET_FORMAT"\n", BITSET_VALUE(instr.bitset)); in disasm()
846 state->options->post_instr_cb(state->options->cbdata, state->n, instr.bitset); in disasm()
871 const struct isa_bitset *bitset = scope->bitset; in decode_field() local
896 for (unsigned i = 0; i < bitset->num_decode_fields; i++) { in decode_field()
897 if (!strncmp(bitset->decode_fields[i].name, field_name, field_name_len)) { in decode_field()
898 bitset->decode_fields[i].decode(out, scope, val); in decode_field()
907 const struct isa_bitset *bitset = scope->bitset; in decode_bitset() local
908 decode_bitset_cb(out, scope, bitset); in decode_bitset()
910 const char *display = find_display(scope, bitset); in decode_bitset()
913 decode_error(scope->state, "%s: no display template", bitset->name); in decode_bitset()