Commit Graph

21 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
9df0b09301 Add an inst.all_typevars() method.
Get all type variables controlling an instruction, whether it is
polymorphic or not.
2017-07-28 14:45:56 -07:00
Jakob Stoklund Olesen
06bab60fcc Add support for type variable wildcards in bound instructions.
Instructions will multiple type variables can now use `any` to indicate
encodings that don't care about the value of a secondary type variable:

    ishl.i32.any instead of ishl.i32.i32

This is only allowed for secondary type variables (which are converted
to instruction predicates). The controlling type variable must still be
fully specified because it is used to key the encoding tables.
2017-07-26 14:55:26 -07:00
Dimo
9258283e14 Documentation nits; Sematnics syntax cleanup 2017-07-24 14:08:44 -07:00
Dimo
40c86d58b9 Add insturction semantics. Add semantics for vsplit,vconcat,iadd. Add initial tests 2017-07-24 14:08:44 -07:00
Dimo
15a7d50765 Rename Dict[Var, TypeVar] to VarTyping; Add VarMap (Dict[Var,Var]). Add {Ast, Def, Rtl}.{vars(), substitution()} and Def.uses(), Def.definitions() - these enable checking structural equivalence between Rtls and doing variable substitutions between compatible Rtls; Add TypeEnv.permits() routine - allows checking if a given TypeEnv allows a given concrete typing without enumerating all typings (will be useful for determing which semantic transform applies to a given concrete typing). 2017-07-24 14:08:44 -07:00
Jakob Stoklund Olesen
6ee432329d Add an other_side_effects instruction flag.
This is used to indicate instructions that have some side effect that is
not modelled by the more specific instruction flags.
2017-07-12 09:15:40 -07:00
d1m0
a9147ebd30 Add fix for #114 (#115)
* Reduce code duplication in TypeConstraint subclasses; Add ConstrainWiderOrEqual to ti and to ireduce,{s,u}extend and f{promote,demote}; Fix bug in emitting constraint edges in TypeEnv.dot(); Modify runtime constraint checks to reject match when they encounter overflow

* Rename Constrain types to something shorter; Move lane_bits/lane_counts in subclasses of ValueType; Add wider_or_eq function in rust and python;
2017-07-12 08:51:55 -07:00
d1m0
6a9438d274 Add image computation of typesets; Remove TypeVar.singleton_type - instead derive singleton type from typeset; (#104) 2017-06-23 11:57:24 -07:00
Dan Gohman
dc809628f4 Start a very simple GVN pass (#79)
* Skeleton simple_gvn pass.
* Basic testing infrastructure for simple-gvn.
* Add can_load and can_store flags to instructions.
* Move the replace_values function into the DataFlowGraph.
* Make InstructionData derive from Hash, PartialEq, and Eq.
* Make EntityList's hash and eq functions panic.
* Change Ieee32 and Ieee64 to store u32 and u64, respectively.
2017-05-18 18:18:57 -07:00
Dan Gohman
5ff2257b12 Check for unknown instruction attributes. (#80)
* Check for unknown instruction attributes.

* Avoid has_key, at flake8's advice.

* Use AssertionError instead of RuntimeError, per review request.
2017-05-11 10:21:59 -07:00
Jakob Stoklund Olesen
c5f2ef8edb Add mypy types for gen_instr.py.
Declare the Instruction.number opcode number field.
2017-03-30 16:20:40 -07:00
Jakob Stoklund Olesen
a82e521291 Add more mypy annotations. 2017-03-30 15:16:44 -07:00
Jakob Stoklund Olesen
c480f2264a Eliminate InstructionFormat.value_operands and .kinds.
Part of the refactoring of instruction formats. This list is now stored
in the instruction itself as value_opnums.
2017-03-10 10:46:45 -08:00
Jakob Stoklund Olesen
405cc14522 Change index domain for typevar_operand.
An instruction format is now seen as having two separate operand lists:
immediates and values. Change InstructionFormat.typevar_operand to be a
pure index into the value list.
2017-03-10 10:41:39 -08:00
Jakob Stoklund Olesen
2b209c791d Add value_opnums and imm_opnums fields to Instruction.
These two tuples contain operand indexes of the explicit value operands
and immediate operands respectively. We can no longer use the
instruction format value_operands field.
2017-03-10 09:34:30 -08:00
Jakob Stoklund Olesen
58756e5d34 Add is_call and is_return instruction attributes. 2017-03-08 14:48:50 -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
Dominik Inführ
93aa2b456e added Opcode flags methods
generate `is_branch`, `is_terminator`, `can_trap` methods for `enum
Opcode`.
2016-12-02 15:50:28 -08:00
Jakob Stoklund Olesen
45fd134d3e Assign a type variable to all VALUE operands.
A few operands have a fixed type assigned. Create a singleton type
variable for these exceptions. Most instructions are polymorphic, so
this is a little overhead.

Eliminate the Operand.typ field and replace it with an Operand.typevar
field which is always a TypeVar, but which only exists in VALUE
operands.
2016-11-08 14:58:44 -08:00
Jakob Stoklund Olesen
09204ca14a Move ast, xform, and legalize modules.
- cdsl.ast defines classes representing abstract syntax trees.
- cdsl.xform defines classes for instruction transformations.
- base.legalize defines legalization patterns.
2016-11-08 12:33:50 -08:00
Jakob Stoklund Olesen
5fa322f797 Split out instruction definitions.
- cdsl.instructions defines the Instruction class.
- base.instructions defines the base instruction set.
2016-11-08 12:33:50 -08:00