Python InstructionFormat refactoring.

Make some changes that will make it easier to get rid of the
'value_operands' and 'members' fields in the Python InstructionFormat
class. This is necessary to be able to combine instruction formats that
all use a value list representation, but with different fixed value
operands. The goal is to eventually identify formats by a new signature:

   (multiple_results, imm_kinds, num_value_operands)

Start by adding new fields:

- imm_members and imm_kinds are lists describing the format operands,
  excluding any values and variable_args operands.
- num_value_operands is the number of fixed value operands, or None in a
  has_value-list format.

Use these new members in preference to the old ones where possible.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-09 21:03:52 -08:00
parent ec5ee70a5c
commit f3d7485494
3 changed files with 31 additions and 30 deletions

View File

@@ -46,9 +46,8 @@ def unwrap_inst(iref, node, fmt):
fmt.line('ref data,')
else:
# Fields are encoded directly.
for m in iform.members:
if m:
fmt.line('{},'.format(m))
for m in iform.imm_members:
fmt.line('{},'.format(m))
if nvops == 1:
fmt.line('arg,')
elif nvops > 1: