Lines Matching refs:start

56 __gen_uint(uint64_t v, uint32_t start, uint32_t end)
59 const int width = end - start + 1;
66 return v << start;
70 __gen_sint(int32_t v, uint32_t start, uint32_t end)
73 const int width = end - start + 1;
81 return (((uint32_t) v) << start) & ((2ll << end) - 1);
85 __gen_padded(uint32_t v, uint32_t start, uint32_t end)
94 assert((end - start + 1) == 8);
97 return __gen_uint(shift | (odd << 5), start, end);
102 __gen_unpack_uint(const uint8_t *restrict cl, uint32_t start, uint32_t end)
105 const int width = end - start + 1;
108 for (uint32_t byte = start / 8; byte <= end / 8; byte++) {
109 val |= ((uint64_t) cl[byte]) << ((byte - start / 8) * 8);
112 return (val >> (start % 8)) & mask;
116 __gen_unpack_sint(const uint8_t *restrict cl, uint32_t start, uint32_t end)
118 int size = end - start + 1;
119 int64_t val = __gen_unpack_uint(cl, start, end);
125 __gen_unpack_padded(const uint8_t *restrict cl, uint32_t start, uint32_t end)
127 unsigned val = __gen_unpack_uint(cl, start, end);
341 if ":" in str(attrs["start"]):
342 (word, bit) = attrs["start"].split(":")
343 self.start = (int(word) * 32) + int(bit)
345 self.start = int(attrs["start"])
347 self.end = self.start + int(attrs["size"]) - 1
350 if self.type == 'bool' and self.start != self.end:
378 elif self.type in ['uint', 'hex'] and self.end - self.start > 32:
399 return self != field and max(self.start, field.start) <= min(self.end, field.end)
402 def __init__(self, parser, parent, start, count, label):
405 self.start = start
444 def __init__(self, field, path, start, end):
447 self.start = start
453 field_offset = offset + field.start
460 start = field_offset
462 all_fields.append(self.FieldRef(field, field_path, start, end))
467 start = offset + field.start
471 self.collect_words(sub_fields, start, field_path + '.', words)
475 contributor = self.FieldRef(field, field_path, start, end)
476 first_word = contributor.start // 32
521 start = contributor.start
523 contrib_word_start = (start // 32) * 32
524 start -= contrib_word_start
540 (value, start, end)
543 (value, start, end)
546 (value, start, end)
549 (value, start, end)
552 (value, start, end)
554 assert(start == 0 and end == 31)
572 # Given a field (start, end) contained in word `index`, generate the 32-bit
574 def mask_for_word(self, index, start, end):
576 start -= field_word_start
579 start = max(start, 0)
581 count = (end - start + 1)
582 return (((1 << count) - 1) << start)
592 masks = [self.mask_for_word(index, c.start, c.end) for c in word.contributors]
609 args.append(str(fieldref.start))
664 elif field.type in ["uint", "hex"] and (field.end - field.start) >= 32: