Coalesce some formats into MultiAry.

Allow some flexibility in the signature matching for instruction
formats. In particular, look for a value list format as a second chance
option.

The Return, ReturnReg, and TernaryOverflow formats all fit the single
MultiAry catch-all format for instructions without immediate operands.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-10 12:17:12 -08:00
parent 6021da8e1c
commit 519eb1934b
8 changed files with 50 additions and 99 deletions

View File

@@ -11,7 +11,7 @@ instruction formats described in the reference:
from __future__ import absolute_import
from cdsl.isa import EncRecipe
from cdsl.predicates import IsSignedInt
from base.formats import Binary, BinaryImm, ReturnReg
from base.formats import Binary, BinaryImm, MultiAry
from .registers import GPR
# The low 7 bits of a RISC-V instruction is the base opcode. All 32-bit
@@ -86,4 +86,4 @@ I = EncRecipe(
# I-type encoding for `jalr` as a return instruction. We won't use the
# immediate offset.
# The variable return values are not encoded.
Iret = EncRecipe('Iret', ReturnReg, ins=GPR, outs=())
Iret = EncRecipe('Iret', MultiAry, ins=GPR, outs=())