decodetree: Fix comparison of Field
PATCH 1/1 decodetree: Fix comparison of Field
Typo comparing the sign of the field, twice, instead of also comparing the mask of the field (which itself encodes both position and length).
Reported-by Peter Maydell <[email protected]>
Signed-off-by Richard Henderson <[email protected]>
--- scripts/decodetree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/decodetree.py +1 -1
@@ -184,7 +184,7 @@ class Field: return '{0}(insn, {1}, {2})'.format(extr, self.pos, self.len) def __eq__(self, other): - return self.sign == other.sign and self.sign == other.sign + return self.sign == other.sign and self.mask == other.mask def __ne__(self, other): return not self.__eq__(other)
Signature · 1 line
2.17.1
Quoted 15 lines · Richard Henderson
Typo comparing the sign of the field, twice, instead of also comparing the mask of the field (which itself encodes both position and length).
Reported-by Peter Maydell <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- scripts/decodetree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/decodetree.py +0
-0
scripts/decodetree.py class Field:
Quoted 9 lines
scripts/decodetree.py +1
-2@@ -184,7 +184,7 @@ class Field: return '{0}(insn, {1}, {2})'.format(extr, self.pos, self.len) def __eq__(self, other): - return self.sign == other.sign and self.sign == other.sign + return self.sign == other.sign and self.mask == other.mask def __ne__(self, other): return not self.__eq__(other) --
Reviewed-by Peter Maydell <[email protected]>
This fixes the problems I was seeing with the VFP decodetree conversion I was working on.
thanks
-- PMM
Quoted 14 lines · Richard Henderson
Typo comparing the sign of the field, twice, instead of also comparing the mask of the field (which itself encodes both position and length).
Reported-by Peter Maydell <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- scripts/decodetree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/decodetree.py +0
-0
scripts/decodetree.py class Field: · line 187
Quoted 5 lines
scripts/decodetree.py +1
-1@@ -184,7 +184,7 @@ class Field: return '{0}(insn, {1}, {2})'.format(extr, self.pos, self.len) def __eq__(self, other): - return self.sign == other.sign and self.sign == other.sign + return self.sign == other.sign and self.mask == other.mask
Argh
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Quoted 4 lines
scripts/decodetree.py +0
-0def __ne__(self, other): return not self.__eq__(other)