Add RISC-V arithmetic w/immediate operand encodings.

Add new instruction predicates to support the 'I' encoding recipe: IsSignedInt,
IsUnsignedInt used to test that an immediate operand is in the allowed range.
This commit is contained in:
Jakob Stoklund Olesen
2016-08-23 14:45:24 -07:00
parent 5a5688e446
commit 1da15a10d7
4 changed files with 106 additions and 9 deletions

View File

@@ -725,6 +725,12 @@ class FormatField(object):
def __str__(self):
return '{}.{}'.format(self.format.name, self.name)
def rust_name(self):
if self.format.boxed_storage:
return 'data.' + self.name
else:
return self.name
class Instruction(object):
"""
@@ -983,9 +989,13 @@ class EncRecipe(object):
:py:class:`InstructionFormat`.
"""
def __init__(self, name, format):
def __init__(self, name, format, instp=None, isap=None):
self.name = name
self.format = format
self.instp = instp
self.isap = isap
if instp:
assert instp.predicate_context() == format
class Encoding(object):