Commit Graph

10588 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
8d6d59cc7a Gather comments in the preamble of a test file.
Comments preceding the first function are not associated with any
specific entity in the file. Put them in a TestFile::preamble_comments
field.
2016-11-04 10:42:31 -07:00
Jakob Stoklund Olesen
c1b7080bf6 Gather comments in the preamble of a test file.
Comments preceding the first function are not associated with any
specific entity in the file. Put them in a TestFile::preamble_comments
field.
2016-11-04 10:42:31 -07:00
Jakob Stoklund Olesen
a2b7769a51 Revisit expanded instructions for legalization.
When an illegal instruction is replaced with other instructions, back up
and revisit the expanded instructions. The new instructions need to have
encodings assigned too.

This also allows for expansions to contain illegal instructions that
need to be legalized themselves.
2016-11-04 09:44:11 -07:00
Jakob Stoklund Olesen
1641365f01 Revisit expanded instructions for legalization.
When an illegal instruction is replaced with other instructions, back up
and revisit the expanded instructions. The new instructions need to have
encodings assigned too.

This also allows for expansions to contain illegal instructions that
need to be legalized themselves.
2016-11-04 09:44:11 -07:00
Jakob Stoklund Olesen
1c57f43643 Add Cursor::set_position.
Make it possible to move a cursor to a new position.

In the current implementation of Layout and Cursor, this is a trivial
operation, but if we switch to a B-tree based function layout, this
involves navigating the tree.
2016-11-04 08:44:01 -07:00
Jakob Stoklund Olesen
63fc81541e Add Cursor::set_position.
Make it possible to move a cursor to a new position.

In the current implementation of Layout and Cursor, this is a trivial
operation, but if we switch to a B-tree based function layout, this
involves navigating the tree.
2016-11-04 08:44:01 -07:00
Jakob Stoklund Olesen
1a9abdd158 Add narrowing legalization patterns for bitwise ops.
RISC-V 32-bit tests for band.i64, bor.i64, bxor.i64.
2016-11-04 08:02:37 -07:00
Jakob Stoklund Olesen
9086c6c8f0 Add narrowing legalization patterns for bitwise ops.
RISC-V 32-bit tests for band.i64, bor.i64, bxor.i64.
2016-11-04 08:02:37 -07:00
Jakob Stoklund Olesen
e59b47c41a Return a Result from the TargetIsa::encode() method.
When an instruction can't be encoded, provide a viable legalization
action in the form of a Legalize enum.
2016-11-03 19:15:36 -07:00
Jakob Stoklund Olesen
e24291fe4c Return a Result from the TargetIsa::encode() method.
When an instruction can't be encoded, provide a viable legalization
action in the form of a Legalize enum.
2016-11-03 19:15:36 -07:00
Jakob Stoklund Olesen
9c02fe3553 Legalization pattern emission WIP.
Begin emitting legalization patterns in the form of two functions,
'expand' and 'narrow' that are included in legalizer.rs.

The generated code compiles, but it is not fully working yet. We need to
deal with the special cases of instructions producing multiple results.
2016-11-03 19:13:54 -07:00
Jakob Stoklund Olesen
125fe64121 Legalization pattern emission WIP.
Begin emitting legalization patterns in the form of two functions,
'expand' and 'narrow' that are included in legalizer.rs.

The generated code compiles, but it is not fully working yet. We need to
deal with the special cases of instructions producing multiple results.
2016-11-03 19:13:54 -07:00
Jakob Stoklund Olesen
814d1728aa Add a Value::unwrap_direct() method.
When it is known that a value is the first result of an instruction, it
is safe to unwrap the instruction reference.
2016-11-03 19:13:54 -07:00
Jakob Stoklund Olesen
3bb6efba6e Add a Value::unwrap_direct() method.
When it is known that a value is the first result of an instruction, it
is safe to unwrap the instruction reference.
2016-11-03 19:13:54 -07:00
Jakob Stoklund Olesen
0543bb049c Save a reference from a Var to its src and dst defs.
When a Var is used in an XForm, it can be defined in the src or dst or
both patterns, and it is classified accordingly. When a Var is defined,
it is also useful to be able to find the `Def` that defined it.

Add src_def and dst_def reference members to Var, and initialize them in
the private Var copies that XForm creates for itself.

These two members also replace the defctx bitmask.
2016-11-03 12:37:24 -07:00
Jakob Stoklund Olesen
026c899042 Save a reference from a Var to its src and dst defs.
When a Var is used in an XForm, it can be defined in the src or dst or
both patterns, and it is classified accordingly. When a Var is defined,
it is also useful to be able to find the `Def` that defined it.

Add src_def and dst_def reference members to Var, and initialize them in
the private Var copies that XForm creates for itself.

These two members also replace the defctx bitmask.
2016-11-03 12:37:24 -07:00
Jakob Stoklund Olesen
f652dcffe4 Set expectations. 2016-11-02 14:41:48 -07:00
Jakob Stoklund Olesen
f2c7a1d57b Set expectations. 2016-11-02 14:41:48 -07:00
Jakob Stoklund Olesen
318e3b9b33 Classify Vars in patterns.
There's 4 classes of variables, depending on whether they have defs in
the source and destination patterns.

Add more XForm verification: In a legalize XForm, all source defs must
be outputs.

Fix a legalize pattern bug caught by this.
2016-11-02 14:34:48 -07:00
Jakob Stoklund Olesen
1ba8e9e05b Classify Vars in patterns.
There's 4 classes of variables, depending on whether they have defs in
the source and destination patterns.

Add more XForm verification: In a legalize XForm, all source defs must
be outputs.

Fix a legalize pattern bug caught by this.
2016-11-02 14:34:48 -07:00
Jakob Stoklund Olesen
c7d1f90b71 Canonicalize the objects in an RTL list.
Any Apply objects in the input are converted to Defs with empty def
lists.
2016-11-02 14:28:37 -07:00
Jakob Stoklund Olesen
88cbd5a43b Canonicalize the objects in an RTL list.
Any Apply objects in the input are converted to Defs with empty def
lists.
2016-11-02 14:28:37 -07:00
Jakob Stoklund Olesen
e1dae95828 Fix inconsistent instruction name.
The 'fpromote' instruction was renamed from 'fcvt_ftof', but the name
argument was not changed.
2016-11-02 10:45:59 -07:00
Jakob Stoklund Olesen
22e75b1271 Fix inconsistent instruction name.
The 'fpromote' instruction was renamed from 'fcvt_ftof', but the name
argument was not changed.
2016-11-02 10:45:59 -07:00
Jakob Stoklund Olesen
a5675b6138 Add glossary entries for IL and IR. 2016-11-02 09:58:02 -07:00
Jakob Stoklund Olesen
0b7010e367 Add glossary entries for IL and IR. 2016-11-02 09:58:02 -07:00
Jakob Stoklund Olesen
ececaa902d Add type annotations to TypeVar 2016-11-01 14:23:41 -07:00
Jakob Stoklund Olesen
bfeb9e4839 Add type annotations to TypeVar 2016-11-01 14:23:41 -07:00
Jakob Stoklund Olesen
679448af72 Run unittests with Python 3 if it is available.
The check.sh script always runs the Python unittests with 'python', but
if 'python3' is in the path, run it with that too.

Fix a Python 3 compat issue and avoid passing None to max() and min().
Use an explicit intersect() function instead to intersect intervals.
2016-11-01 12:01:40 -07:00
Jakob Stoklund Olesen
b7634ae5c3 Run unittests with Python 3 if it is available.
The check.sh script always runs the Python unittests with 'python', but
if 'python3' is in the path, run it with that too.

Fix a Python 3 compat issue and avoid passing None to max() and min().
Use an explicit intersect() function instead to intersect intervals.
2016-11-01 12:01:40 -07:00
Jakob Stoklund Olesen
cf9ce038e9 Typo 2016-10-28 11:49:35 -07:00
Jakob Stoklund Olesen
c2dc400572 Typo 2016-10-28 11:49:35 -07:00
Benjamin Bouvier
419e686581 Fix a few typos in the docs; 2016-10-28 11:31:22 -07:00
Benjamin Bouvier
de10910324 Fix a few typos in the docs; 2016-10-28 11:31:22 -07:00
Sean Gillespie
4d729bf986 Use items instead of iteritems for Python 3 compatibility 2016-10-28 08:45:37 -07:00
Sean Gillespie
409ce91513 Use items instead of iteritems for Python 3 compatibility 2016-10-28 08:45:37 -07:00
Joel Gallant
65052b8450 Typo fix 2016-10-28 08:38:23 -07:00
Joel Gallant
72479b53ff Typo fix 2016-10-28 08:38:23 -07:00
Benjamin Bouvier
18f32f8b56 Add build instructions in the REAME; 2016-10-28 08:36:21 -07:00
Benjamin Bouvier
2cb126341b Add build instructions in the REAME; 2016-10-28 08:36:21 -07:00
Jakob Stoklund Olesen
baf9195080 Add a document comparing Cretonne and LLVM. 2016-10-27 13:41:39 -07:00
Jakob Stoklund Olesen
2fa707bc4f Add a document comparing Cretonne and LLVM. 2016-10-27 13:41:39 -07:00
Jakob Stoklund Olesen
80823b5fc4 Require documentation on cretonne public items. 2016-10-26 19:10:06 -07:00
Jakob Stoklund Olesen
3da569de06 Require documentation on cretonne public items. 2016-10-26 19:10:06 -07:00
Jakob Stoklund Olesen
e2418c6ec9 Require documentation on reader public items. 2016-10-26 17:43:18 -07:00
Jakob Stoklund Olesen
7b3160dbbb Require documentation on reader public items. 2016-10-26 17:43:18 -07:00
Jakob Stoklund Olesen
447baf015e Require documentation on filecheck public items. 2016-10-26 17:34:45 -07:00
Jakob Stoklund Olesen
77cc962380 Require documentation on filecheck public items. 2016-10-26 17:34:45 -07:00
Jakob Stoklund Olesen
15f626ccc0 Begin generating code for the legalizer.
This is a work in progress. The 'legalizer.rs' file generated by
gen_legalizer.py is not used for anything yet.

Add PEP 484 type annotations to a bunch of Python code.
2016-10-26 16:06:57 -07:00
Jakob Stoklund Olesen
bcd5bc559c Begin generating code for the legalizer.
This is a work in progress. The 'legalizer.rs' file generated by
gen_legalizer.py is not used for anything yet.

Add PEP 484 type annotations to a bunch of Python code.
2016-10-26 16:06:57 -07:00