Commit Graph

1000 Commits

Author SHA1 Message Date
Tyler McMullen
79cea5e18b Implement jump tables (#453)
* Add 'jump_table_entry' and 'indirect_jump' instructions.

* Update CodeSink to keep track of code size. Pretty up clif-util's disassembly output.

* Only disassemble the machine portion of output. Pretty print the read-only data after it.

* Update switch frontend code to use new br_table instruction w/ default.
2018-10-03 10:04:21 -07:00
Benjamin Bouvier
0b3d3ac880 Remove logging levels restrictions (#538)
* Fixes #537: Remove release mode logging levels restrictions;

* Add information about log's logging levels in the README;
2018-10-02 10:45:23 -07:00
Dan Gohman
75e4ff62a0 Update to filecheck 0.4.0. 2018-09-27 17:30:16 -07:00
Dan Gohman
44f1ee5518 Comment that test-all.sh runs checks on the Python files. 2018-09-27 16:50:01 -07:00
Dan Gohman
6fdd58d143 Tidy up one last mention of EntityMap. 2018-09-27 09:07:44 -07:00
Dan Gohman
87e43ccb94 Mention in the README that we avoid using callstack recursion.
Callstack recursion has the property that the maximum stack depth can
grow significantly, depending on the input program. Cranelift uses
several recursive algorithms, however it uses explicit heap-based
stacks to do so.
2018-09-26 13:07:43 -07:00
bjorn3
2eec1469a8 Legalize some more i8/i16 intructions (#524)
* Legalize some more i8/i16 intructions
2018-09-25 16:10:23 -07:00
Bruce Mitchener
c8a65a721c clippy: Remove useless format call. 2018-09-24 09:40:32 -07:00
Bruce Mitchener
e07e159bda filetests: run_passes can take &str, not &String. 2018-09-24 09:40:32 -07:00
Sergey Pepyakin
2a7cc7e644 Bump wabt version to 0.6. 2018-09-23 16:35:33 -07:00
Dan Gohman
ab99720959 Bump version to 0.22.0 2018-09-21 21:39:41 -07:00
Dan Gohman
10edc1b6ab Format src/wasm.rs with newer rustfmt. 2018-09-21 21:29:14 -07:00
Dan Gohman
46beddecde Update to capstone 0.5.0. 2018-09-21 20:58:22 -07:00
Dan Gohman
8055abf90d Add a mention of simplejit-demo to the README. 2018-09-21 20:52:59 -07:00
Dan Gohman
ea0c196c11 More introductory documentation (#520)
* Add a comment to .rustfmt.toml explaning why it's here.

* Use `<details>` for specialized information in README.md.

* Describe a more elaborate issue-labelling system.
2018-09-21 20:16:55 -07:00
Dan Gohman
fd081f2af8 Update README.md to mention the actual version of Rust supported. 2018-09-21 19:50:05 -07:00
Dan Gohman
e7565a8893 Mention the Windows x64 calling convention support in README.md. 2018-09-21 19:49:24 -07:00
Dan Gohman
c840fb2f08 Move tests/moduletests.rs into lib/simplejit/tests.
These tests depend on cranelift-simplejit, which is higher-level than the
other crates they depend on, so lib/simplejit is a good place for them.
2018-09-19 20:19:57 -07:00
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
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
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
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
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
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
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
Dan Gohman
c836a96e30 Bump cranelift-entity version to 0.20.1. 2018-08-28 20:19:09 -07:00
Dan Gohman
f834afb5f6 Bump cranelift-wasm version to 0.20.1. 2018-08-28 17:18:36 -07:00
Dan Gohman
7fa0a38793 Bump version to 0.20.0 2018-08-28 16:37: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
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
Grégoire Geis
0e67255f52 Fix error not reported if at least one other error expected. (#485)
* fix error not reported if at least one other error expected.

* Fixed unused extern crate error if wasm feature is not enabled.

* No longer reporting deref cycles multiple times.

* Fix filetest type_check.clif.

* Switched comparison order for perf.

* Fixed isa/riscv/verify-encoding.clif filetest.
2018-08-28 10:33:46 -07:00
Dan Gohman
9eee91fc12 Clarify that we use rustfmt-preview.
This may help avoid confusion with older rustfmt versions.
2018-08-27 16:28:24 -07:00
Dan Gohman
eab8f784fa Rename nop.cton to nop.clif. 2018-08-27 16:28:24 -07:00
Dan Gohman
0a65089a36 Add a CONTRIBUTING.md file (#479)
* Add a CONTRIBUTING.md file.

* Document the basic PR process.

This also introduces the Core Team.
2018-08-23 11:03:52 -07:00
Caroline Cullen
0f93ef5cee Changing from docopt to clap for the clif-util #434 (#463)
* Changing from docopt to clap for the clif-util

* Updates to cargo file.

* Remove filecheck subcommand.
2018-08-22 11:25:55 -07:00
Dan Gohman
3d89a8645b Fix rustfmt errors. 2018-08-16 15:26:53 -07:00