Collect and number all active encoding recipes.
The recipes are shared across CPU modes.
This commit is contained in:
@@ -976,9 +976,24 @@ class TargetISA(object):
|
||||
|
||||
:returns self:
|
||||
"""
|
||||
self._collect_encoding_recipes()
|
||||
self._collect_instruction_predicates()
|
||||
return self
|
||||
|
||||
def _collect_encoding_recipes(self):
|
||||
"""
|
||||
Collect and number all encoding recipes in use.
|
||||
"""
|
||||
self.all_recipes = list()
|
||||
rcps = set()
|
||||
for cpumode in self.cpumodes:
|
||||
for enc in cpumode.encodings:
|
||||
recipe = enc.recipe
|
||||
if recipe not in rcps:
|
||||
recipe.number = len(rcps)
|
||||
rcps.add(recipe)
|
||||
self.all_recipes.append(recipe)
|
||||
|
||||
def _collect_instruction_predicates(self):
|
||||
"""
|
||||
Collect and number all instruction predicates in use.
|
||||
|
||||
Reference in New Issue
Block a user