Commit Graph

1829 Commits

Author SHA1 Message Date
Dan Gohman
e6db8e278c Rename one more "local" to "explicit_slot". 2018-03-15 22:32:47 -07:00
Dan Gohman
5e5fcefdfd Add Travis builds with Rust nightly.
See [here](https://docs.travis-ci.com/user/languages/rust/) for details.
2018-03-15 21:37:31 -07:00
Dan Gohman
e2f3079d8b Tidy up redundant commands in test-all.sh. 2018-03-15 21:37:08 -07:00
Dan Gohman
4dbafb45c7 Update to num_cpus 1.8, and other updates. 2018-03-15 21:09:59 -07:00
Dan Gohman
e889b88d04 Split filecheck out into its own repo. 2018-03-15 15:35:48 -07:00
Dan Gohman
965b93bd2a Move the filetest harness into its own crate.
This allows us to run the tests via a library call rather than just
as a command execution. And, it's a step toward a broader goal, which
is to keep the code in the top-level src directory minimal, with
important functionality exposed as crates.
2018-03-15 15:35:48 -07:00
Dan Gohman
00af7a28f3 Run the filetests as part of "cargo test".
Refactor the filetests harness so that it can be run as part of
`cargo test`. And begin reorganizing the test harness code in preparation
for moving it out of the src directory.
 - Test subcommand files are now named `test_*.rs`.
 - cton-util subcommand files now just export their `run` and nothing else.
 - src/filetest/mod.rs now also just exports `run` and nothing else.
 - Tests are now run in release mode (with debug assertions enabled).
2018-03-15 13:38:21 -07:00
Dan Gohman
b2acd457d5 Use OrderedDict rather than explicit sorting.
This reduces churn in the generated files, making it easier to inspect
changes.
2018-03-15 10:35:06 -07:00
Dan Gohman
c842b9aaa1 Code cleanup: import OrderedDict rather than collections.OrderedDict 2018-03-15 10:13:26 -07:00
Dan Gohman
bb82bac3af Tweak the Gitter URLs. 2018-03-14 12:40:20 -07:00
Dan Gohman
48fc161b8b Add a badge for a Gitter chat room.
I don't know how much interest there will be in Gitter, but if
there is some, I'm interested in trying it out.
2018-03-14 11:26:02 -07:00
Dan Gohman
272d03d8fc Add a utility for generating Rust 'match' expressions.
This makes it a little simpler to generate 'match' statements, and
it performs deduplication of identical arms. And it means I don't
have to think about as many strings like '{} {{ {}.. }} => {}'
when I'm trying to think about how instructions work :-).
2018-03-14 10:51:09 -07:00
Dan Gohman
d9712f5d7d Elaborate on some comments in generated source files.
Recipe names are fairly obscure, so the more context we can give
when using them the better.
2018-03-14 10:51:09 -07:00
Dan Gohman
cc8d6400f4 Rename builder.rs to inst_builder.rs.
This reflects its purpose, to define the `InstBuilder` trait.
2018-03-14 10:51:09 -07:00
Dan Gohman
3afe85ff17 Auto-generate InstructionData.
The meta description has all the information to generate the `InstructionData`
enum, so generate it rather than having a manually-maintained copy.
2018-03-14 10:51:09 -07:00
Afnan Enayet
9128290fb4 Rename ILBuilder to FunctionBuilderContext (#268)
* Rename `ILBuilder` to `FunctionBuilderContext` and update corresponding
code

* Refactor usages of ILBuilder to become FunctionBuilderContext,
update variable names to reflect this change

* Reformat to ensure that lines stay under 100 char limit

* Apply corrections from `rustfmt` to pass tests

* Rename variables to be more consistent with refactor of ILBuilder
2018-03-14 10:48:06 -07:00
Dan Gohman
44ca27beec Update to wasmparser 0.15.1. 2018-03-13 09:34:20 -07:00
Dan Gohman
e776d987fd Add Cargo.toml badges for published packages.
This adds a basic travis badge, as well as a badge indicating
"experimental" status, since the APIs are still evolving.
2018-03-13 09:34:11 -07:00
Dan Gohman
aaf0def241 Add lint overrides for unused extern crate hashmap_core.
This allows these files to build with both the `no_std` and `std`
features enabled at the same time.
2018-03-12 14:09:34 -07:00
Dan Gohman
1a671cf82f Remove uses of println! in tests.
In this case, it's a little nicer to just use more assertions,
which will print their line number indicating how far the test
got, when they fail.

And this allows the tests to be run in no_std configurations.
2018-03-12 14:06:15 -07:00
Dan Gohman
f9b9b4b8a4 Merge remote-tracking branch 'origin/master' into no_std 2018-03-12 13:06:47 -07:00
Dan Gohman
2b9229d715 Fix > 80-column lines for flake8. 2018-03-12 13:02:55 -07:00
Dan Gohman
4a3077d638 Merge remote-tracking branch 'origin/master' into no_std 2018-03-12 12:55:57 -07:00
Dan Gohman
11eddafef8 Avoid using floating-point values in expand_fcvt_to_sint.
Compute the bound values for expand_fcvt_to_sint using bitwise integer
arithmetic rather than floating-point arithmetic, to avoid relying on
host floating point arithmetic.
2018-03-12 12:50:58 -07:00
Dan Gohman
f04e02c0a1 Clarify comments about Conventional SSA form.
Captialize "Conventional" so that it's clear that "Conventional SSA"
is a specific concept being referenced.
2018-03-12 12:38:30 -07:00
Dan Gohman
30f8daa9d6 Replace assert! with debug_assert! in production code paths.
This allows the assertions to be disabled in release builds, so that
the code is faster and smaller, at the expense of not performing the
checks. Assertions can be re-enabled in release builds with the
debug-assertions flag in Cargo.toml, as the top-level Cargo.toml
file does.
2018-03-12 12:38:30 -07:00
Dan Gohman
e81a27fb5d Implement Debug for ArgAction and Affinity. 2018-03-12 12:38:30 -07:00
Dan Gohman
ad363d7e6b Replace cretonne-wasm's Local with cretonne-frontend's Variable.
Previously, cretonne-wasm used its own Local struct for identifying
local variables. However, now that cretonne-frontend provides a
Variable struct, just use that instead.
2018-03-12 12:38:30 -07:00
Dan Gohman
b8a106adf0 Remove the "has_sse2" flag.
Cretonne currently requires SSE2 support pervasively, so it's not meaningful
to have a setting for it.
2018-03-12 12:38:01 -07:00
Dan Gohman
e441337e4b Bump version to 0.3.4 2018-03-09 16:32:13 -08:00
Dan Gohman
1c72ccfe0a Define a Variable struct so that frontends don't have to.
Frontends can still use their own types with `ILBuilder` and
`FunctionBuilder`. This just provides a basic `Variable` struct
for frontends that want it.
2018-03-09 15:08:54 -08:00
Dan Gohman
56c7d85727 More minor code simplifications. 2018-03-09 15:08:54 -08:00
Dan Gohman
55d0efcb14 Pass the wasmparser::Operator by value, simplifying the code. 2018-03-09 15:08:54 -08:00
Dan Gohman
8df9fe6c87 Fix obsolete paths in comments. 2018-03-09 15:08:54 -08:00
Dan Gohman
b9d7a43439 Elaborate on Cretonne's rustc backend goals. (#257)
* Elaborate on Cretonne's rustc backend goals.

* Remove these extra newlines. They don't show up in the rendered form anyway.

* Fix typo.

* The document is meant to speak with the voice of the project.
2018-03-08 06:07:18 -08:00
Dan Gohman
b5f428b6f2 Bump version to 0.3.3 2018-03-08 02:50:09 -08:00
Dan Gohman
40ec50d0b6 Don't relax a branch to have different input constraints.
When relaxing a branch, restrict the set of candidate encodings to those which
have the same input constraints as the original encoding choice. This prevents
situations where relaxation prefers a non-REX-prefixed encoding over a REX
prefixed one because the end of the instruction can be one byte closer to the
destination, in a situation where the encoding needs to be REX-prefixed
because of one of the operand registers.

This also makes the Context class perform encoding verification after
relaxation, to catch similar problems in the future.

Fixes #256.
2018-03-08 02:34:41 -08:00
Dan Gohman
6cf9bf36b8 Fix a typo in a comment. 2018-03-08 02:26:15 -08:00
Dan Gohman
ee0bce4106 Bump version to 0.3.2 2018-03-05 16:17:00 -08:00
Dan Gohman
136d6f5c4b Implement ireduce, sextend, and uextend between i8/i16 and i32/i64. 2018-03-05 15:13:59 -08:00
Dan Gohman
b1697dd1dc Style: Don't use else after a return. 2018-03-05 14:34:35 -08:00
Dan Gohman
ae0801e23b Disable creation of .pyc files.
Cretonne's python scripts aren't run very often, so there's little
benefit in creating .pyc files. And the .pyc files cause trouble for
some vendoring scripts. So disable them.
2018-03-05 14:05:13 -08:00
Dan Gohman
1a4723831b Add an encoding step to "cton-util compile". 2018-03-05 14:02:45 -08:00
Dan Gohman
d119524c90 Bump version to 0.3.1 2018-03-05 07:11:23 -08:00
Dan Gohman
bf480c341b Use https rather than http for several URLs. 2018-03-05 06:55:27 -08:00
Dan Gohman
6e94e70f30 Use an https URL rather than http.
Found by sphinx's linkcheck.
2018-03-05 06:55:27 -08:00
Dan Gohman
be84db8e86 Fix glossary references. 2018-03-05 06:55:27 -08:00
Dan Gohman
c59e9180de Tidy up whitespace. 2018-03-05 06:55:27 -08:00
Dan Gohman
0ea0146e58 Update to sphinx-autogen 1.5.6. 2018-03-05 06:55:27 -08:00
Bruce Mitchener
d2d02565fb I64Extend16S should operate on 16 bits, not 8.
This showed up in clippy warnings as the code for this case was
the same as for `I64Extend8S`.
2018-03-05 06:53:13 -08:00