Generate code to precompute predicates.

Each ISA predicate is assigned a bit the the Flags struct, and a corresponding
method is generated.
This commit is contained in:
Jakob Stoklund Olesen
2016-08-11 17:38:56 -07:00
parent 13d33d5a7a
commit c998c79fe8
5 changed files with 135 additions and 15 deletions

View File

@@ -63,6 +63,15 @@ class BoolSetting(Setting):
else:
return 0
def rust_predicate(self, prec):
"""
Return the Rust code to compute the value of this setting.
The emitted code assumes that the setting group exists as a local
variable.
"""
return '{}.{}()'.format(self.group.name, self.name)
class NumSetting(Setting):
"""