Lines Matching +full:low +full:- +full:pass

3 # Copyright © 2019-2024 Google, Inc.
5 # SPDX-License-Identifier: MIT
48 pass
51 def __init__(self, name, low, high, shr, type, parser): argument
53 self.low = low
60 maxpos = parser.current_bitsize - 1
62 if low < 0 or low > maxpos:
63 raise parser.error("low attribute out of range: %d" % low)
66 if high < low:
67 raise parser.error("low is greater than high: low=%d, high=%d" % (low, high))
68 if self.type == "boolean" and not low == high:
70 elif self.type == "float" and not (high - low == 31 or high - low == 15):
94 elif self.type == "float" and self.high - self.low == 31:
97 elif self.type == "float" and self.high - self.low == 15:
113 tab_count = (68 - (len(name) & ~7)) // 8
118 def mask(low, high): argument
119 return ((0xffffffffffffffff >> (64 - (high + 1 - low))) << low)
126 # <reg32 offset="0x88db" name="RB_BLIT_DST_ARRAY_PITCH" low="0" high="28" shr="6" type="uint"/>
134 # indices - array of (ctype, stride, __offsets_NAME)
168 known_mask |= mask(f.low, f.high)
172 print(" assert((%-40s & 0x%08x) == 0);" % (val, 0xffffffff ^ mask(0 , f.high - f.low)))
173 print(" assert((%-40s & 0x%08x) == 0);" % ("fields.unknown", known_mask))
188 print(" (%-40s << %2d) |" % (val, f.low))
202 print(" .bo_low = %d," % address.low)
264 if not f.name and f.low == 0 and f.shr == 0 and not f.type in ["float", "fixed", "ufixed"]:
265 pass
266 elif f.type == "boolean" or (f.type == None and f.low == f.high):
267 tab_to("#define %s" % name, "0x%08x" % (1 << f.low))
269 tab_to("#define %s__MASK" % name, "0x%08x" % mask(f.low, f.high))
270 tab_to("#define %s__SHIFT" % name, "%d" % f.low)
275 print("\tassert(!(val & 0x%x));" % mask(0, f.shr - 1))
360 pass
363 pass
436 # template based struct-packers for these
451 parser, filename = self.stack[-1]
467 high = low = int(attrs["pos"], 0)
468 elif "high" in attrs and "low" in attrs:
470 low = int(attrs["low"], 0)
472 low = 0
473 high = self.current_bitsize - 1
485 b = Field(name, low, high, shr, type, self)
505 if "-" in variant:
506 variant = variant[:variant.index("-")]
516 # with open ended ranges (ie. "A2XX,A4XX-") (we have the varset
547 parser, filename = self.stack[-1]
740 offsets.append(offsets[-1] + 1)
744 offsets.append(offsets[-1] + 1)
792 # sub-structure.
872 This file was generated by the rules-ng-ng gen_header.py tool in this git repository:
876 The rules-ng-ng source files this header was generated from are:
882 pad = " " * (maxlen - len(filepath))
884 filesize = " " * (7 - len(filesize)) + filesize
886 print("- " + filepath + pad + " (" + filesize + " bytes, from " + filetime + ")")
890 print("Copyright (C) %s-%s by the following authors:" % (p.copyright_year, current_year))
892 print("- " + author)
949 parser.add_argument('--rnn', type=str, required=True)
950 parser.add_argument('--xml', type=str, required=True)
951 parser.add_argument('--validate', default=False, action='store_true')
952 parser.add_argument('--no-validate', dest='validate', action='store_false')
957 parser_c_defines = subparsers.add_parser('c-defines')
960 parser_c_pack_structs = subparsers.add_parser('c-pack-structs')
963 parser_py_defines = subparsers.add_parser('py-defines')