Commit Graph

6 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
2c845ad65c Eliminate InstructionFormat.members.
This field is no longer needed. We can use imm_members to get the names
of immediate fields, and num_value_operands to access values.
2017-03-10 10:04:30 -08:00
Jakob Stoklund Olesen
703762a67c 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.
2017-03-09 21:54:22 -08:00
Jakob Stoklund Olesen
582a048089 Convert return formats to value lists.
With the Return and ReturnReg formats converted to using value lists for
storing their arguments, thee are no remaining instruction formats with
variable argument lists in boxed storage.

The Return and ReturnReg formats are also going to be merged since
they are identical now.
2017-03-09 15:56:33 -08:00
Jakob Stoklund Olesen
364b8e5f0a Use value lists for call arguments.
Add a new kind of instruction format that keeps all of its value
arguments in a value list. These value lists are all allocated out of
the dfg.value_lists memory pool.

Instruction formats with the value_list property set store *all* of
their value arguments in a single value list. There is no distinction
between fixed arguments and variable arguments.

Change the Call instruction format to use the value list representation
for its arguments.

This change is only the beginning. The intent is to eliminate the
boxed_storage instruction formats completely. Value lists use less
memory, and when the transition is complete, InstructionData will have a
trivial Drop implementation.
2017-03-09 14:34:07 -08:00
Jakob Stoklund Olesen
8c5a69eb47 Fixed for mypy 0.501.
The List and Dict types are no longer implicitly available. They must be
imported from typing.

Type annotations must appear before the doc comment in a function. Also
fix type errors in these functions that weren't detected before.
2017-03-03 09:08:28 -08:00
Jakob Stoklund Olesen
2a15130518 Split out instruction formats.
- cdsl.formats provides classes for describing instruction formats.
- base.formats provides concrete instruction format definitions.
2016-11-08 11:48:05 -08:00