From 6a8a4c43c2bfdca57b3f6470e594cf8fa67cf886 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 26 Aug 2016 14:48:28 -0700 Subject: [PATCH] Collect and number all active encoding recipes. The recipes are shared across CPU modes. --- meta/cretonne/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meta/cretonne/__init__.py b/meta/cretonne/__init__.py index 324dc76b4b..2e316982c0 100644 --- a/meta/cretonne/__init__.py +++ b/meta/cretonne/__init__.py @@ -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.