Generate encoding tables. (WIP).
Amend build script to generate an encodings-<isa>.rs file for each target ISA. Emit a function that can evaluate instruction predicates. Describe the 3-level tables used for representing insrruction encoding tables. Add Python classes representing the tables. The generated code is incomplete and not used anywhere yet.
This commit is contained in:
@@ -51,12 +51,21 @@ class Formatter(object):
|
||||
self.indent = self.indent[0:-self.shiftwidth]
|
||||
|
||||
def line(self, s=None):
|
||||
"""And an indented line."""
|
||||
"""Add an indented line."""
|
||||
if s:
|
||||
self.lines.append('{}{}\n'.format(self.indent, s))
|
||||
else:
|
||||
self.lines.append('\n')
|
||||
|
||||
def outdented_line(self, s):
|
||||
"""
|
||||
Emit a line outdented one level.
|
||||
|
||||
This is used for '} else {' and similar things inside a single indented
|
||||
block.
|
||||
"""
|
||||
self.lines.append('{}{}\n'.format(self.indent[0:-self.shiftwidth], s))
|
||||
|
||||
def writelines(self, f=None):
|
||||
"""Write all lines to `f`."""
|
||||
if not f:
|
||||
|
||||
Reference in New Issue
Block a user