Commit Graph

2094 Commits

Author SHA1 Message Date
Dan Gohman
2fe96c30a6 Check in the Crane and Ferris drawing so that people can remix it :-).
Fixes #514.
2018-09-13 15:30:39 -07:00
Dan Gohman
53a0c6c67f Update to the rustfmt in rust 1.29, which is now stable. 2018-09-13 12:59:25 -07:00
Dan Gohman
f23ea04242 Fix a panic when splitting a critical edge on a jump_table with nulls.
This fixes #505.
2018-09-12 16:59:03 -07:00
Dan Gohman
f6519c87a4 Improve the assertion failure message for sealing a block twice. 2018-09-12 16:58:36 -07:00
Dan Gohman
f2177deec1 Improve assertion messages in Module finalization.
When an object being finalized references an object declared as needing
a definition, the definition needs to be available. Add asserts to catch
this specific case.
2018-09-12 16:07:43 -07:00
Dan Gohman
9e65b694bd Minor code simplification; avoid an unneeded match. 2018-09-12 16:07:14 -07:00
Dan Gohman
d0f703a6ff Fix the type of table bounds in DummyEnvironment.
Also, fix the wasm testsuite harness to run the verifier with a
TargetIsa so that it catches problems like this.
2018-09-12 14:40:20 -07:00
Maddy
52e6b07058 Update the reload pass to replace copies with fill/spill instructions. 2018-09-12 14:15:45 -07:00
Nick Fitzgerald
ea85018ccf clif-util: fix clif-util pass subcommand arguments
Because of the way that the `pass` subcommand orders its arguments, the
positional "single-file" input cannot be optional with a default value, because
it is followed by required positional arguments. If it were optional, that would
result in argument ambiguity where `clap` cannot tell if the optional positional
argument is supplied, or if the given argument is the next required positional
argument.

Before this commit:

```
$ cargo run --bin clif-util -- pass ./filetests/dce/basic.clif dce
   Compiling cranelift-tools v0.21.0 (file:///Users/fitzgen/src/cranelift)
    Finished dev [unoptimized + debuginfo] target(s) in 4.38s
     Running `target/debug/clif-util pass ./filetests/dce/basic.clif dce`
thread 'main' panicked at 'Found positional argument which is not required with a lower index than a required positional argument: "single-file" index 1', /Users/fitzgen/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0/src/app/parser.rs:612:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```

After this commit:

```
$ cargo run --bin clif-util -- pass ./filetests/dce/basic.clif dce
   Compiling cranelift-filetests v0.21.0 (file:///Users/fitzgen/src/cranelift/lib/filetests)
   Compiling cranelift-tools v0.21.0 (file:///Users/fitzgen/src/cranelift)
    Finished dev [unoptimized + debuginfo] target(s) in 5.96s
     Running `target/debug/clif-util pass ./filetests/dce/basic.clif dce`
1 tests
```
2018-09-11 10:16:14 -07:00
Dan Gohman
9ebe1cc26c Merge pull request #503 from joshuawarner32/simplejit-example-improvements
Improve simplejit-example
2018-09-11 09:49:07 -07:00
Dan Gohman
40bcd613cd Merge branch 'master' into simplejit-example-improvements 2018-09-11 09:45:43 -07:00
Dan Gohman
cadb76ef71 Rename "Cretonne" to "Cranelift" in image files. 2018-09-10 10:00:45 -07:00
Dan Gohman
b4c7451ae5 Bump version to 0.21.1 2018-09-10 10:00:45 -07:00
Joshua Warner
f012bd8500 Demonstrate arguments, returns, and adds in example 2018-09-06 22:29:44 -07:00
Joshua Warner
e051e9f4c8 Fix std feature propagation 2018-09-06 22:29:43 -07:00
Nick Fitzgerald
90756a8a01 clif-util: Default to reading input files from stdin
Fixes #495
2018-09-06 17:35:26 -07:00
Nick Fitzgerald
8fb681b86d clif-util wasm: don't panic when terminal colors are unsupported
This breaks inside of Emacs' `M-x shell` and `compilation-mode`.
2018-09-06 17:35:26 -07:00
Dan Gohman
da0243b0ab Update docs to reflect that saturating fp-to-int conversion is now implemented. 2018-09-05 16:35:41 -07:00
Dan Gohman
f3c46ad2a2 Add more documentation about Module and Backend. 2018-09-05 15:19:37 -07:00
Dan Gohman
437a657899 Document tables. 2018-09-05 14:30:34 -07:00
Dan Gohman
8d41d2cc43 Add more documentation for special parameters. 2018-09-05 14:30:34 -07:00
Dan Gohman
608e74d8cb Document that b8 etc. are intended for use as SIMD elements. 2018-09-05 14:23:03 -07:00
Dan Gohman
1e0c9b546b Move simplejit after the umbrella crate in publish-all.sh.
Simplejit's example program uses the umbrella, so publish it after the
umbrella crate to preserve the topological ordering.
2018-09-05 13:49:10 -07:00
Dan Gohman
e8878ba504 Bump version to 0.21.0 2018-09-04 22:04:22 -07:00
Dan Gohman
112e4a6083 Add a use std::vec::Vec; to fix the no_std build. 2018-09-04 21:57:32 -07:00
Dan Gohman
d4b8622393 Rename the VOID type to INVALID and clean up obsolete comments.
The VOID type isn't used for anything resembling what "void" means in C,
so rename it to INVALID to avoid confusion.
2018-09-04 21:46:22 -07:00
Dan Gohman
18900df4d5 Clean up obsolete comments. 2018-09-04 21:22:50 -07:00
Dan Gohman
ca9da7702e Reorganize the global value kinds. (#490)
* Reorganize the global value kinds.

This:
 - renames "deref" global values to "load" and gives it a offset that works
   like the "load" instructions' does
 - adds an explicit "iadd_imm" global value kind, which replaces the
   builtin iadd in "vmctx" and "deref" global values.
 - also renames "globalsym" to "symbol"
2018-09-04 21:09:04 -07:00
Caroline Cullen
59b83912ba Adds pass command to clif-util. (#487)
* Adds pass command to clif-util.
2018-09-04 16:31:24 -07:00
Aaron Power
17bb62c16c Added bitrev instruction for 32 and 64 bit integers (#486) 2018-09-04 16:23:50 -07:00
Kaz Wesley
7e571f4a49 Print value aliases at referrent definition (#492)
* Print value aliases at referrent definition

Closes #488.
2018-09-04 15:02:46 -07:00
Dan Gohman
4045d50b7b Add a Code of Conduct (#481)
* Create CODE_OF_CONDUCT.md

* Mention the Code of Conduct in CONTRIBUTING.md.

* Add @tyler's email address as an additional contact.
2018-08-31 04:16:36 -07:00
Benjamin Bouvier
300a76469f wasm: Clear tables too in TranslationState::clear(); (#491) 2018-08-30 09:01:07 -07:00
Dan Gohman
67b7a8594a Implementing Deref in PrimaryMap turns out to be error-prone, so remove it.
One of the big advantages of PrimaryMap is that it protects against
using the wrong indices via a distinct index type. A Deref trait that
returns a plain slice would accept other indices. Add a comment
explaining this.
2018-08-28 20:55:06 -07:00
Dan Gohman
c836a96e30 Bump cranelift-entity version to 0.20.1. 2018-08-28 20:19:09 -07:00
Dan Gohman
1affd5eae7 Add Deref and DerefMut implementations for PrimaryMap. 2018-08-28 20:19:01 -07:00
Dan Gohman
f834afb5f6 Bump cranelift-wasm version to 0.20.1. 2018-08-28 17:18:36 -07:00
Dan Gohman
fcd859a45e Make FuncIndex and DefinedFuncIndex implement the Debug trait. 2018-08-28 17:05:49 -07:00
Dan Gohman
7fa0a38793 Bump version to 0.20.0 2018-08-28 16:37:52 -07:00
Dan Gohman
0842825c38 Minor code simplification. 2018-08-28 16:30:51 -07:00
Dan Gohman
c23bfdaa91 Minor code simplification. 2018-08-28 16:24:10 -07:00
Dan Gohman
d2943ec32d Add a minimal SimpleJIT example program.
This minimally demonstrates usage of the API, and serves as a very small
testcase to test that the basic JIT mechanisms are working.
2018-08-28 16:13:23 -07:00
Dan Gohman
bdd1949b34 Don't pass Copy objects by reference. 2018-08-28 15:33:18 -07:00
Dan Gohman
9ada394d11 [SimpleJIT] When finalizing multiple functions, make them all executable at the end. (#474)
Add `publish()` function to cranelift-module's `Backend` trait, which
allows `finalize_all()` to defer making memory executable until it
has finished all of the patching it needs to do.
2018-08-28 15:27:52 -07:00
Dan Gohman
8e2d01a675 Add an index_type field to Table.
This parallels the `index_type` field in `Heap`.
2018-08-28 14:28:43 -07:00
Dan Gohman
0d24641f21 Fix a verifier test failure.
This test was accidentally relying on the bug that #485 fixed.
2018-08-28 13:50:28 -07:00
Dan Gohman
eb439c9a68 Fix legalization of heap_addrs with 32-bit indices. (#480)
This makes several changes:
 - It adds an index_type to heap declarations, allowing heaps to specify the
   type for indexing. This also anticipates 64-bit heap support.

 - It adds a memory_type to deref global values, allowing deref globals to
   have types other than pointers. This is used to allow the bound variable
   in dynamic heaps to have type i32, to match the index type in heaps
   with i32 index type.

 - And, it fixes heap legalization to do the bounds check in the heap's
   index type.
2018-08-28 13:37:33 -07:00
Dan Gohman
00ddf3a7a6 Update to serde_derive 1.0.75. 2018-08-28 13:23:55 -07:00
Dan Gohman
ba8dd836ff Update to wabt 0.5.0. 2018-08-28 13:23:37 -07:00
Dan Gohman
6af407144c Remove Signature's argument_bytes field.
It's not currently used. If we do need such information, it would be
better to compute it on demand.
2018-08-28 13:19:59 -07:00