Commit Graph

109 Commits

Author SHA1 Message Date
bjorn3
3f582f7cbd Legalize br_icmp (#449)
* Legalize br_icmp
2018-08-13 18:31:39 -07:00
Dan Gohman
51698f93f2 Merge branch 'master' into bforest 2018-08-13 15:55:31 -07:00
Dan Gohman
4769e67468 Fix a few declarations for the no_std build. 2018-08-13 12:52:43 -07:00
Dan Gohman
d4a83576e4 Add a few miscellaneous comments. 2018-08-13 12:51:49 -07:00
Dan Gohman
cc4bf1c7fb Deny unstable_features in "std" builds. 2018-08-13 12:51:49 -07:00
Benjamin Bouvier
a044f58cea Fixes #404: Use log.rs and a file-per-thread logger instead of the dbg! macro; 2018-08-13 12:51:14 -07:00
Amanieu d'Antras
0b548c720c Don't make the Comparator a type argument for bforest 2018-08-12 15:46:35 +02:00
Amanieu d'Antras
ae3a3c368b Move bforest into a separate crate 2018-08-12 15:46:35 +02:00
Benjamin Bouvier
f7e481d9ac Implement wasm saturating conversions; 2018-08-09 19:50:41 -07:00
Sergey Pepyakin
9dbfbbde10 Stack Limit as an Argument Purpose (#372)
* Initial approach.

* Move stack_limit check before opening the frame

* Account for GPRs and frame pointer in stack check

* Check stack_limit example.

* Remove stack_limit attribute code.

Amends #359

* fmt
2018-08-04 06:16:21 -07:00
Bruce Mitchener
76a7efc8db Clippy improvements (#408)
* clippy: Allow subsec_nanos usage for now.

The recommendation from clippy requires Rust 1.27, but we currently
support Rust 1.25 and later.

* Simplify ref pattern matches.

This was recommended by clippy.
2018-08-02 22:10:51 -07:00
Dan Gohman
1b30265c5c Define a "table" concept.
"Table" is to WebAssembly tables as "Heap" is to WebAssembly linear
memories.
2018-08-02 15:21:34 -07:00
Dan Gohman
cd75176f10 Update to the rustfmt in rust 1.28, which is now stable.
Also, rustfmt's --write-mode=check is now named --check.
2018-08-02 09:55:40 -07:00
Dan Gohman
26d122306d Don't attempt to shrink regfill/regspill/regmove instructions.
This is a temporary workaround for bugs such as #420, where normal
operand constraint checking doesn't correctly handle such instructions.
2018-08-02 09:53:25 -07:00
Dan Gohman
c61f8a5baf Rename langref.rst to ir.rst.
This aligns with our use of the term "IR" rather than "IL" or
other terms involving "language".
2018-08-02 09:18:59 -07:00
Dan Gohman
bc8e5f82c8 Add use declarations needed for no_std mode. 2018-08-01 14:10:54 -07:00
Dan Gohman
f89cb1df64 Fix the test script to return an error if formatting diffs are found. 2018-08-01 13:24:53 -07:00
bjorn3
01729be8d7 Add comment support (#379)
* Add comment support

* Don't print empty comments

* Add nop instruction

* Add test and note

* Add FuncWriter trait

* Remove comment support

* Add write_preamble to FuncWriter

* Fix test

* Some changes
2018-08-01 11:21:05 -07:00
Dan Gohman
c42bed7452 Update paths for the meta => meta-python rename. 2018-08-01 05:05:33 -07:00
Benjamin Bouvier
3a550d185f Enhance Verifier error reporting; 2018-07-31 08:02:14 -07:00
Dan Gohman
1b42105faa Remove reserved_reg functionality. (#424)
* Remove reserved_reg functionality.

This wasn't implemented, and if we need it in the future, it seems like
it would be better to extend the concept of global values to cover this.

* Use GlobalValue::reserved_value() for sentinal values.
2018-07-31 07:57:37 -07:00
Dan Gohman
e0124fa82f Rename local variables to clarify their purpose. 2018-07-26 11:14:52 -07:00
Dan Gohman
15520fa961 Enable a few more clippy lints. 2018-07-26 10:10:36 -07:00
Aaron Power
cc7ba7e69a Fixed remaning clippy warnings 2018-07-25 13:05:14 -07:00
Aaron Power
952a086f32 Fixed trivially_copy_pass_by_ref warnings 2018-07-25 10:31:01 -07:00
Aaron Power
eed861c6e1 Implemented clippy improvements 2018-07-24 12:36:34 -07:00
Benjamin Bouvier
f72ff791b4 Promote the BasicBlock tuple to a real struct;
It makes reading code that uses it easier to understand.
2018-07-23 15:26:11 -07:00
Benjamin Bouvier
03159a9200 Misc refactorings when looking at the wasm code; 2018-07-19 06:39:56 -07:00
Dan Gohman
1081d06173 Use the new realm-switching ABI in the baldrdash calling convention. 2018-07-17 22:44:00 -07:00
Dan Gohman
2db2d946b8 Support the rustc in the latest Ubuntu LTS.
At this time, this is Bionic, with Rust 1.25.0.
2018-07-13 16:26:21 -07:00
Lachlan Sneff
202e45c213 Fix broken build on no_std 2018-07-13 16:26:02 -07:00
Dan Gohman
f4dbd38a4c Rename Cretonne to Cranelift! 2018-07-13 09:15:16 -07:00
Benjamin Bouvier
bcc268a3cd [clippy] Fix a few clippy issues in lib/codegen/;
- don't generate "&& true" when generating instruction eq() fn;
- use more Self;
- use subsec_millis instead of subsec_nanos and divide;
- coalesce two ifs;
2018-07-11 13:47:25 -07:00
Amanieu d'Antras
5c7aeb46dd Make InstructionData comparable and hashable (#388)
* Don't implement Eq and Hash for EntityList

* Generate eq and hash methods for InstructionData

* Use the eq() and hash() methods of InstructionData in simple_gvn
2018-07-06 12:09:20 -07:00
Grégoire Geis
dd72b54eef Now diagnosing missing vmctx arguments (fixes #376) (#384)
* Now diagnosing missing vmctx arguments (fixes #376).

* Added filetest for fix of #376.

* Respect formatting rules in verifier/mod.rs.

* Added parameters for each use of vmctx in test files.

* Added comments on additions on vmctx verifications.
2018-07-03 20:59:32 -07:00
Dan Gohman
ff5660624d Clarify wording in a comment. 2018-07-02 22:44:50 -07:00
Dan Gohman
8f3c49bc6c Update more references to "global variables".
This continues the transition to "global values", which aren't
implicitly dereferenced.
2018-06-28 12:52:51 -07:00
Caroline Cullen
7bed3426a7 Adds decoration to the verifier errors. (#375)
* Adds decoration to the verifier errors.

example:

function %bad(i32) fast {
ebb0(v0: i32):
    brnz.i32 v0, ebb1
    return
    ^~~~~~

verifier inst1: Internal return not allowed with return_at_end=1

ebb1:
    trapz.i32 v0, user6
    return
}

Fixes #68
2018-06-28 10:17:27 -07:00
Dan Gohman
c5aad1eb5f Add support for macho relocations. (#378)
This requires splitting X86PCRel4 into two separate relocations, to
distinguish the case where the instruction is a call, as Mach-O uses a
different relocation in that case.

This also makes it explicit that only x86-64 relocations are supported
currently.
2018-06-28 10:15:10 -07:00
Dan Gohman
cc94adca3b Update to the rustfmt in rust 1.27, which is now stable. (#377) 2018-06-26 13:06:16 -07:00
Dan Gohman
7d2b44289c Implement stack_addr, stack_load, stack_store for x86-64. (#370) 2018-06-26 06:15:21 -07:00
Dan Gohman
979162522e Keep a comment in sync with the code. 2018-06-21 16:24:33 -07:00
Dan Gohman
593e2bae6c Add timers for branch relaxation and instruction shrinking. 2018-06-21 16:18:34 -07:00
Dan Gohman
d209137149 Rename TargetIsa's emit_function to emit_function_to_memory.
This reflects the fact that it takes a concrete `MemoryCodeSink` rather than
a `CodeSink` trait object.
2018-06-21 15:50:29 -07:00
Lachlan Sneff
b3c3ca331b Removed implicit indirection when computing heap base. (#363)
Fix expected legalized heap_addr
2018-06-16 07:31:52 -07:00
Lachlan Sneff
f97ad59991 Fix breaking change 2018-06-15 18:33:30 -07:00
Lachlan Sneff
38ab82bcc0 Made changes for review 2018-06-15 18:33:30 -07:00
Lachlan Sneff
3686fc2fc7 Fix typos caused by find-and-replace 2018-06-15 18:33:30 -07:00
Lachlan Sneff
5c320a0d30 Change GlobalVar to GlobalValue 2018-06-15 18:33:30 -07:00
Dan Gohman
1cab2f2d73 Remove an unneeded comment. 2018-06-13 07:41:39 -07:00