diff options
author | Richard Henderson | 2020-05-16 20:19:45 +0200 |
---|---|---|
committer | Richard Henderson | 2020-06-08 19:36:47 +0200 |
commit | df63044d02bf79241257bafe282d966c86933b68 (patch) | |
tree | eeb1bbf91422696c9f71551a633857501fc61652 /scripts | |
parent | decodetree: Rename MultiPattern to IncMultiPattern (diff) | |
download | qemu-df63044d02bf79241257bafe282d966c86933b68.tar.gz qemu-df63044d02bf79241257bafe282d966c86933b68.tar.xz qemu-df63044d02bf79241257bafe282d966c86933b68.zip |
decodetree: Split out MultiPattern from IncMultiPattern
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/decodetree.py | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 7af6b3056d..ea313bcdea 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -371,28 +371,43 @@ class Pattern(General): # end Pattern -class IncMultiPattern(General): - """Class representing an overlapping set of instruction patterns""" +class MultiPattern(General): + """Class representing a set of instruction patterns""" - def __init__(self, lineno, pats, fixb, fixm, udfm, w): + def __init__(self, lineno, pats): self.file = input_file self.lineno = lineno self.pats = pats self.base = None - self.fixedbits = fixb - self.fixedmask = fixm - self.undefmask = udfm - self.width = w + self.fixedbits = 0 + self.fixedmask = 0 + self.undefmask = 0 + self.width = None def __str__(self): - r = "{" - for p in self.pats: - r = r + ' ' + str(p) - return r + "}" + r = 'group' + if self.fixedbits is not None: + r += ' ' + str_match_bits(self.fixedbits, self.fixedmask) + return r def output_decl(self): for p in self.pats: p.output_decl() +# end MultiPattern + + +class IncMultiPattern(MultiPattern): + """Class representing an overlapping set of instruction patterns""" + + def __init__(self, lineno, pats, fixb, fixm, udfm, w): + self.file = input_file + self.lineno = lineno + self.pats = pats + self.base = None + self.fixedbits = fixb + self.fixedmask = fixm + self.undefmask = udfm + self.width = w def output_code(self, i, extracted, outerbits, outermask): global translate_prefix |