From 40468430a42e03615c19b12a846601baabccaa19 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Tue, 25 Jan 2022 01:01:17 -0500 Subject: [PATCH] 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 Reviewed-by: Rob Clark Part-of: --- src/compiler/isaspec/isa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/isaspec/isa.py b/src/compiler/isaspec/isa.py index 62257d971bc..22976caa492 100644 --- a/src/compiler/isaspec/isa.py +++ b/src/compiler/isaspec/isa.py @@ -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