isaspec: fix gen_max to be 2^32-1

The minus sign has higher preference than shift:

>>> 1 << 32 - 1
2147483648
>>> (1 << 32) - 1
4294967295

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14789>
This commit is contained in:
Ilia Mirkin 2022-01-25 01:01:17 -05:00
parent 9dc30f99ae
commit 40468430a4

View file

@ -265,7 +265,7 @@ class BitSet(object):
self.encode = BitSetEncode(xml.find('encode'))
self.gen_min = 0
self.gen_max = 1 << 32 - 1
self.gen_max = (1 << 32) - 1
for gen in xml.findall('gen'):
if 'min' in gen.attrib:
@ -351,7 +351,7 @@ class BitSet(object):
if self.extends is not None:
parent = self.isa.bitsets[self.extends]
assert (self.gen_max == (1 << 32 - 1)) or (self.gen_max <= parent.get_gen_max()), "bitset {} should not have max gen higher than the parent's one".format(self.name)
assert (self.gen_max == (1 << 32) - 1) or (self.gen_max <= parent.get_gen_max()), "bitset {} should not have max gen higher than the parent's one".format(self.name)
return min(self.gen_max, parent.get_gen_max())
return self.gen_max