Commit Graph

6452 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
56cb249e13 Add support for enumerated settings.
The EnumSetting objects can take one of 256 named values.
2016-08-09 15:13:43 -07:00
Jakob Stoklund Olesen
1ef72dd5ec Add support for enumerated settings.
The EnumSetting objects can take one of 256 named values.
2016-08-09 15:13:43 -07:00
Jakob Stoklund Olesen
530234ad32 Add settings::Stringwise.
This trait allows settings to be manipulated as strings, using descriptors and
constant hash-table lookups.

Amend gen_settings.py to generate the necessary constant tables.
2016-08-09 15:04:42 -07:00
Jakob Stoklund Olesen
07e851a222 Add settings::Stringwise.
This trait allows settings to be manipulated as strings, using descriptors and
constant hash-table lookups.

Amend gen_settings.py to generate the necessary constant tables.
2016-08-09 15:04:42 -07:00
Jakob Stoklund Olesen
24ec62d030 Move simple_hash into its own module. 2016-08-09 15:04:42 -07:00
Jakob Stoklund Olesen
d152719d93 Move simple_hash into its own module. 2016-08-09 15:04:42 -07:00
Jakob Stoklund Olesen
4efb0efb44 Add ISA-dependent settings for RISC-V. 2016-08-05 16:19:46 -07:00
Jakob Stoklund Olesen
36ad7da3ec Add ISA-dependent settings for RISC-V. 2016-08-05 16:19:46 -07:00
Jakob Stoklund Olesen
1925c1b2c2 Scaffolding for defining settings.
Settings can be defined globally or per-ISA. They are available to code through
a generated Settings struct with accessor methods per setting.
2016-08-05 15:50:57 -07:00
Jakob Stoklund Olesen
cfeefde3fc Scaffolding for defining settings.
Settings can be defined globally or per-ISA. They are available to code through
a generated Settings struct with accessor methods per setting.
2016-08-05 15:50:57 -07:00
Jakob Stoklund Olesen
c679a2e746 Scaffold implementation of the TargetIsa trait.
More to come here.
2016-08-05 09:55:53 -07:00
Jakob Stoklund Olesen
6b69391289 Scaffold implementation of the TargetIsa trait.
More to come here.
2016-08-05 09:55:53 -07:00
Jakob Stoklund Olesen
1a4d07d437 Rename meta/target -> meta/isa.
Clarify terminology by always referring to a 'Target ISA' instead of just
'Target'. Use 'isa' as a module name instead of 'target' both in Rust and Python
code.

This is only to clarify terminology and not at all because Cargo insists on
using the 'target' sub-directory for build products. Oh, no. Not at all.
2016-08-04 11:50:19 -07:00
Jakob Stoklund Olesen
92f84c655b Rename meta/target -> meta/isa.
Clarify terminology by always referring to a 'Target ISA' instead of just
'Target'. Use 'isa' as a module name instead of 'target' both in Rust and Python
code.

This is only to clarify terminology and not at all because Cargo insists on
using the 'target' sub-directory for build products. Oh, no. Not at all.
2016-08-04 11:50:19 -07:00
Jakob Stoklund Olesen
6d786113db Add an empty isa/riscv module scaffold.
Targeted ISAs will be defined as sub-modules of isa.
2016-08-04 11:39:25 -07:00
Jakob Stoklund Olesen
c47c524017 Add an empty isa/riscv module scaffold.
Targeted ISAs will be defined as sub-modules of isa.
2016-08-04 11:39:25 -07:00
Jakob Stoklund Olesen
afdc4960d7 Don't sphinx-autobuild on Vim .swp file changes. 2016-08-04 11:28:38 -07:00
Jakob Stoklund Olesen
5bd2117ad7 Don't sphinx-autobuild on Vim .swp file changes. 2016-08-04 11:28:38 -07:00
Jakob Stoklund Olesen
5a8293427d Verify that type variables have been fully bound.
The shift instructions have two type variables since the shift amount can be a
differently sized integer. Fix the RISC-V shift encodings to reflect this, and
allow i64 registers to be shifted by an i32 amount.
2016-08-04 10:21:48 -07:00
Jakob Stoklund Olesen
24c97ce6e5 Verify that type variables have been fully bound.
The shift instructions have two type variables since the shift amount can be a
differently sized integer. Fix the RISC-V shift encodings to reflect this, and
allow i64 registers to be shifted by an i32 amount.
2016-08-04 10:21:48 -07:00
Jakob Stoklund Olesen
a1cc8af186 Use dot syntax to bind type variables on instructions.
Encodings need to refer to concrete instances of polymorphic instructions by
binding type variables. Allow dot syntax like iadd.i32 to do that.
2016-08-03 16:30:47 -07:00
Jakob Stoklund Olesen
c1d32167dc Use dot syntax to bind type variables on instructions.
Encodings need to refer to concrete instances of polymorphic instructions by
binding type variables. Allow dot syntax like iadd.i32 to do that.
2016-08-03 16:30:47 -07:00
Jakob Stoklund Olesen
4987282bbb Add an Encoding meta-language class.
Start adding some RISC-V encodings too as a way of testing the ergonomics.
2016-08-03 16:04:29 -07:00
Jakob Stoklund Olesen
9cdf6edd62 Add an Encoding meta-language class.
Start adding some RISC-V encodings too as a way of testing the ergonomics.
2016-08-03 16:04:29 -07:00
Jakob Stoklund Olesen
66f14138bb Add an EncRecipe meta-language class.
Move the CPUMode reference from EncRecipe to the Encoding itself, allowing
EncRecipes to be shared between CPU modes. At least RISC-V should be able to
share some recipes between RV32 and RV64 modes.
2016-08-03 12:06:21 -07:00
Jakob Stoklund Olesen
d215b622e4 Add an EncRecipe meta-language class.
Move the CPUMode reference from EncRecipe to the Encoding itself, allowing
EncRecipes to be shared between CPU modes. At least RISC-V should be able to
share some recipes between RV32 and RV64 modes.
2016-08-03 12:06:21 -07:00
Jakob Stoklund Olesen
eed6adb413 Add a CPUMode meta-language class. 2016-08-03 11:20:13 -07:00
Jakob Stoklund Olesen
c4faef196e Add a CPUMode meta-language class. 2016-08-03 11:20:13 -07:00
Jakob Stoklund Olesen
a67ec211a4 Document binary encodings.
Describe the meta-language data structures that are built to represent
instruction encodings.

Begin a metaref glossary.
2016-08-02 16:02:20 -07:00
Jakob Stoklund Olesen
bd72439fbc Document binary encodings.
Describe the meta-language data structures that are built to represent
instruction encodings.

Begin a metaref glossary.
2016-08-02 16:02:20 -07:00
Jakob Stoklund Olesen
82a85961ff Add PrimaryEntityData marker trait.
Require this trait on the value type stored in an EntityMap to 'unlock' the
methods intended for primary entity maps that are allowed to create references
with the 'push method.

This prevents accidentally depending on these methods in secondary maps.
2016-08-01 19:52:57 -07:00
Jakob Stoklund Olesen
f5008567c9 Add PrimaryEntityData marker trait.
Require this trait on the value type stored in an EntityMap to 'unlock' the
methods intended for primary entity maps that are allowed to create references
with the 'push method.

This prevents accidentally depending on these methods in secondary maps.
2016-08-01 19:52:57 -07:00
Morgan Phillips
4c0b59a947 Merge branch 'master' of github.com:stoklund/cretonne into cfg-fix 2016-08-01 18:06:59 -07:00
Morgan Phillips
549a14bf96 Merge branch 'master' of github.com:stoklund/cretonne into cfg-fix 2016-08-01 18:06:59 -07:00
Morgan Phillips
283f3ea48e Remove uses of EntityMap::len. 2016-08-01 18:04:25 -07:00
Morgan Phillips
80abf8b1f0 Remove uses of EntityMap::len. 2016-08-01 18:04:25 -07:00
Jakob Stoklund Olesen
11f65fff20 Remove the cfg::predecessors_iter() method and iterator.
This iterator enumerates all EBB references whether they are in the layout or
not. That is usually not what is needed when working with the CFG.

It is better to iterate over EBB referrences in layout order, or in reverse
post-order and then call the get_predecessors() method for each Ebb reference.

See the new implementation of print_cfg::cfg_connections().
2016-08-01 15:18:34 -07:00
Jakob Stoklund Olesen
2c1e80b0e0 Remove the cfg::predecessors_iter() method and iterator.
This iterator enumerates all EBB references whether they are in the layout or
not. That is usually not what is needed when working with the CFG.

It is better to iterate over EBB referrences in layout order, or in reverse
post-order and then call the get_predecessors() method for each Ebb reference.

See the new implementation of print_cfg::cfg_connections().
2016-08-01 15:18:34 -07:00
Jakob Stoklund Olesen
bf24ae229c Print CFG edges from func.layout instead of cfg.predecessors_iter.
EBBs not in the layout should never be printed as part of the CFG.
2016-08-01 15:18:34 -07:00
Jakob Stoklund Olesen
02c1bb8f2c Print CFG edges from func.layout instead of cfg.predecessors_iter.
EBBs not in the layout should never be printed as part of the CFG.
2016-08-01 15:18:34 -07:00
Morgan Phillips
e22efd2748 Improve the structure and comments of the module. 2016-08-01 15:00:08 -07:00
Morgan Phillips
e9cfcf4f78 Improve the structure and comments of the module. 2016-08-01 15:00:08 -07:00
Morgan Phillips
f2e9c88b45 Remove println\! 2016-08-01 12:15:08 -07:00
Morgan Phillips
5a38ca2db7 Remove println\! 2016-08-01 12:15:08 -07:00
Morgan Phillips
967a7c64d4 Add a dominator tree implementation. 2016-07-31 21:40:11 -07:00
Morgan Phillips
19a47d57b3 Add a dominator tree implementation. 2016-07-31 21:40:11 -07:00
Morgan Phillips
a8beb542a5 Clean up the CFG representation. 2016-07-31 21:31:18 -07:00
Morgan Phillips
0ce01c1b8d Clean up the CFG representation. 2016-07-31 21:31:18 -07:00
Jakob Stoklund Olesen
dae349371f Add EntityMap::with_capacity.
Create a secondary entity map with space reserved for a known range of entity
references.

Add dfg.num_ebbs() and dfg.num_insts() methods to provide capacities.
2016-07-29 15:59:09 -07:00
Jakob Stoklund Olesen
bbdae39cb9 Add EntityMap::with_capacity.
Create a secondary entity map with space reserved for a known range of entity
references.

Add dfg.num_ebbs() and dfg.num_insts() methods to provide capacities.
2016-07-29 15:59:09 -07:00