Commit Graph

2765 Commits

Author SHA1 Message Date
Benjamin Bouvier
93696a80bb Fixes #614: Implement a debug trap; 2018-12-10 14:14:04 -05:00
Dan Gohman
f065b39d65 Add Wasmtime as another example user of Cranelift. 2018-12-07 01:01:12 -05:00
Dan Gohman
5d7ece3d15 Fix clippy warning namespaces. 2018-12-06 20:50:38 -05:00
Dan Gohman
5adab629f2 Update to the rustfmt in rust 1.31, which is now stable. 2018-12-06 16:15:48 -05:00
Dan Gohman
323a9925e5 Change the Rust version banner to green, because that looks nicer here. 2018-12-05 19:13:14 -05:00
Dan Gohman
d3eb06209b Enable RUST_BACKTRACE=1 when running "cargo test". 2018-12-05 19:13:10 -05:00
Dan Gohman
fc28923b6e The Gitter chat is currently shared for all CraneStation projects. 2018-12-05 19:13:06 -05:00
Dan Gohman
990e1386f5 Check for cargo fmt rather than checking for rustfmt directly. 2018-11-30 16:17:21 -08:00
Benjamin Bouvier
d94e027c2a [build] Move settings generation from Python to Rust code; 2018-11-30 11:05:21 -06:00
Benjamin Bouvier
4c8f1e7a5a [meta] Ignore empty lines to compute indent when parsing multiple lines; 2018-11-30 11:05:21 -06:00
Benjamin Bouvier
12df943409 [meta] Add support to generate Match expressions in Rust; 2018-11-30 11:05:21 -06:00
Benjamin Bouvier
d15e56a9fa Add build warning only if CRANELIFT_VERBOSE is set to anything; 2018-11-30 11:05:21 -06:00
Dan Gohman
9947c315b7 Fix Python check script to work outside of Travis. 2018-11-30 06:07:18 -08:00
Dan Gohman
416f8c094d Name Table and Memory's initial field minimum and make it u32.
The spec has switched to calling the "initial" field the "minimum" field
because when linear memory is imported, it may initially be greater than
the "initial" value.

Making it u32 instead of usize will help avoid accidental host-specific
behavior.
2018-11-29 15:03:49 +01:00
Dan Gohman
ba48fd2223 Add TODO comments noting temporary bug workarounds. 2018-11-28 17:18:12 -08:00
Dan Gohman
324c821adf Replace 'mypy --version' with adding '--verbose' to the pip3 install command-line. 2018-11-28 16:46:42 -08:00
Dan Gohman
06d269be63 Disable mypy on OSX on Travis. 2018-11-28 16:36:59 -08:00
Dan Gohman
f8754c2cf8 Fix warnings when the "wasm" feature is disabled. 2018-11-28 16:36:59 -08:00
Dan Gohman
9f7a7fa389 Disable wabt and disassembler features on appveyor for now. 2018-11-28 15:47:54 -08:00
Dan Gohman
eaca8d3f2e Enable OSX in Travis CI. 2018-11-28 15:47:03 -08:00
Dan Gohman
0e601ac4a5 Add an appveyor build badge. 2018-11-28 15:46:31 -08:00
Dan Gohman
d8b2def52e Add preliminary appveyor support. 2018-11-28 14:31:53 -08:00
Dan Gohman
ef21fffa1c Clarify Cranelift's design with respect to mid-level optimization. (#619)
* Clarify Cranelift's design with respect to mid-level optimization.

Cranelift doesn't currently do much mid-level optimization, however it
is something we're thinking about, so remove text describing it as out of
scope, and add more text explaining the vision for how it would fit into
the overall system.
2018-11-28 08:54:40 -08:00
Dan Gohman
7c03ba43be Document which instructions are meant for producers to use.
This reorganizes some things in ir.rst to put all instructions not meant
for frontends to worry about in a dedicated section.

Fixes #282.
2018-11-28 06:53:04 -08:00
Zach Reizner
f028c53479 Fix incorrect wasm subcommand 'about' text. 2018-11-27 12:05:46 +01:00
Dan Gohman
30654a6a7d Bump version to 0.25.0 2018-11-26 22:31:07 -08:00
Dan Gohman
09e5b33916 Update to wasmparser 0.22. 2018-11-26 22:18:36 -08:00
Dan Gohman
f0695a79d1 Add an autoinst line for fallthrough_return so that it's included in the docs. 2018-11-26 22:18:36 -08:00
Dan Gohman
f6a6ce3199 Make ModuleEnvironment's target_config() return by value.
This makes it more consistent with the other target_config() functions
which were all changed to return by value.
2018-11-26 22:18:36 -08:00
Dan Gohman
367f3cd5d3 Implement reserve and reserve_exact for PrimaryMap. 2018-11-26 22:18:36 -08:00
Dan Gohman
c17579e7ec Bump version to 0.24.0 2018-11-26 22:18:36 -08:00
Dan Gohman
54c388d870 Make the verifier output even prettier (#599)
* Fix verifier printing to print instruction encodings consistently.

Use `FuncWriter::write_instruction` for all instructions so that
encodings are printed consistently.

* Make use-before-def errors mention the relevant value.

* When there are verifier errors, print a message at the end.

* Make verifier errors prettier.

Fix the length of the "^~~~~" to match the printed entity, and print the
error messsage on its own line.

* Clean up "test verifier" failure messages.

* Tidy the uses-value-from-itself error.

The use instruction is the same as the def instruction, so don't print
both. Also, the use instruction is already being printed at the
beginning, so don't print it again at the end.
2018-11-26 22:18:18 -08:00
Syrus Akbary
737fde04a8 Improved imports (#612)
* Impoved support for wasm global imports

* Refactored parse_import_section improving readability

* Improved support for wasm table imports

* Improved support for wasm memory imports

* Improved formatting

* Added DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex structs
2018-11-25 05:10:58 -08:00
Aaron Power
b11646aba3 Fix bit count bug in emit_small_{memcpy, memset, memmove}. 2018-11-20 22:32:52 -06:00
Syrus Akbary
48186b3199 Make TargetIsa thread-safe 2018-11-20 22:15:40 -06:00
Dan Gohman
0fed78e063 Don't allow loop preheaders to have critical edges.
If the block which would be a preheader for a loop has other successors,
don't hoist instructions into it. Instead create a dedicated preheader.
2018-11-16 10:27:24 +01:00
Dan Gohman
641771ac6a Add encodings to the instructions in LICM's generated preheaders.
When LICM generates a preheader, it needs to add encodings to the
instructions it generates, since it runs after legalization.
2018-11-16 10:27:24 +01:00
Dan Robertson
c7bc1b7c56 Fix fuzz_reader_parse_test
Fix compilation issues with fuzz_reader_parse_test.
2018-11-15 12:23:28 +01:00
Benjamin Bouvier
86cc33673b Add binary tests for codegen of loads/stores involving r12/r13 on x86; 2018-11-14 13:08:54 -08:00
Benjamin Bouvier
b41bc55007 Pretty-print errors for extended basic blocks too; 2018-11-14 13:08:54 -08:00
Benjamin Bouvier
d45e8b5830 Add SIB/offset for ABCD stores too; 2018-11-14 13:08:54 -08:00
Benjamin Bouvier
b170b74b65 Fixes #600: Add a SIB byte when encoding a non-indexed load/store into r12/rsp;
Memory access instructions which took the GPR_ZERO_DEREF_SAFE register
class (that was removed in #600) should check for the need of either an
offset (r13/rbp) or the SIB byte (r12/rsp). Some load/store instructions
would already take an index, thus already contain the SIB byte in this
case (see instructions which have a comment telling that the else branch
already contains an SIB byte). Non-indexed memory accesses lacked the
SIB byte check, which this patch adds.
2018-11-14 13:08:54 -08:00
Dan Gohman
f6617afcdd Remove the build time and directory from cranelift-codegen-meta's output.
This makes its output nondeterministic, making it friendier for
compilation caching tools.
2018-11-14 13:03:00 -08:00
oooooba
155fd4c72a Eliminate call stack recursion in VirtRegs::find (#584)
* Eliminate call stack recursion in VirtRegs::find
2018-11-14 12:58:50 -08:00
bjorn3
5baeed06bb Better incompatible declaration error (#605)
* Better incompatible declaration error

* Change display of IncompatibleSignature error
2018-11-14 10:41:56 -08:00
Dan Gohman
039188a4bf Move Vim integration files into their own repo.
https://github.com/CraneStation/cranelift.vim
2018-11-13 16:13:54 -08:00
Dan Gohman
c2f5bc00a5 Fix typos in comments. 2018-11-12 15:15:02 -08:00
Dan Gohman
cd7c57e598 Make spilling visit fallthrough_return instructions too.
This is a followup to af2a952aabd82cf401cc664d0262b139ff92d86b. It
teaches the spilling pass to use the is_ghost() property to test whether
to visit instructions. This fixes a bug handling multiple return values
with fallthrough_return.
2018-11-12 19:43:55 +01:00
Dan Gohman
ef2e11265c Update to Rust 1.30. 2018-11-12 07:13:53 -08:00
Dan Gohman
f3ea2d5d66 Tidy up documentation comment syntax. 2018-11-12 06:38:50 -08:00