Commit Graph

8716 Commits

Author SHA1 Message Date
Alex Crichton
a33caec9be Bump the wasm-tools crates (#3139)
* Bump the wasm-tools crates

Pulls in some updates here and there, mostly for updating crates to the
latest version to prepare for later memory64 work.

* Update lightbeam
2021-08-04 09:53:47 -05:00
Chris Fallin
9419d635c6 Merge pull request #3138 from sparker-arm/aarch64-extadd-pairwise
Enable simd_X_extadd_pairwise_X for AArch64
2021-08-03 15:47:48 -07:00
Sam Parker
3bc2f0c701 Enable simd_X_extadd_pairwise_X for AArch64
Lower to [u|s]addlp for AArch64.

Copyright (c) 2021, Arm Limited.
2021-08-03 10:25:09 +01:00
Chris Fallin
d551997657 Merge pull request #3137 from cfallin/release-0.29-date
Adjust date of v0.29 release in RELEASES.md to today.
2021-08-02 17:43:47 -07:00
Chris Fallin
4dfb0a6138 Adjust date of v0.29 release in RELEASES.md to today.
This was a bit of an oversight in the relnotes updates for the
just-released v0.29: since the release PR was prepared a few days before
the actual release, I should have updated the "released on" date in
RELEASES.md (oops!). I don't think it's a big enough deal to re-roll
anything but we should have the correct date in the version on `main`.
2021-08-02 16:44:16 -07:00
Chris Fallin
81f1dc944f Merge pull request #3123 from cfallin/release-0.29
Bump to Wasmtime v0.29.0 and Cranelift 0.76.0.
2021-08-02 13:08:58 -07:00
Chris Fallin
a13a777230 Bump to Wasmtime v0.29.0 and Cranelift 0.76.0. 2021-08-02 11:24:09 -07:00
Chris Fallin
07cafd73df Update RELEASES.md with last PRs for 0.29. 2021-08-02 11:24:09 -07:00
Alex Crichton
a9b6dfee93 Update release notes. 2021-08-02 11:18:28 -07:00
Alex Crichton
63a3bbbf5a Change VMMemoryDefinition::current_length to usize (#3134)
* Change VMMemoryDefinition::current_length to `usize`

This commit changes the definition of
`VMMemoryDefinition::current_length` to `usize` from its previous
definition of `u32`. This is a pretty impactful change because it also
changes the cranelift semantics of "dynamic" heaps where the bound
global value specifier must now match the pointer type for the platform
rather than the index type for the heap.

The motivation for this change is that the `current_length` field (or
bound for the heap) is intended to reflect the current size of the heap.
This is bound by `usize` on the host platform rather than `u32` or`
u64`. The previous choice of `u32` couldn't represent a 4GB memory
because we couldn't put a number representing 4GB into the
`current_length` field. By using `usize`, which reflects the host's
memory allocation, this should better reflect the size of the heap and
allows Wasmtime to support a full 4GB heap for a wasm program (instead
of 4GB minus one page).

This commit also updates the legalization of the `heap_addr` clif
instruction to appropriately cast the address to the platform's pointer
type, handling bounds checks along the way. The practical impact for
today's targets is that a `uextend` is happening sooner than it happened
before, but otherwise there is no intended impact of this change. In the
future when 64-bit memories are supported there will likely need to be
fancier logic which handles offsets a bit differently (especially in the
case of a 64-bit memory on a 32-bit host).

The clif `filetest` changes should show the differences in codegen, and
the Wasmtime changes are largely removing casts here and there.

Closes #3022

* Add tests for memory.size at maximum memory size

* Add a dfg helper method
2021-08-02 13:09:40 -05:00
Chris Fallin
87fefd8a21 Merge pull request #3031 from jlb6740/extend-add-pairwise-x64
Add extend-add-pairwise instructions x64
2021-07-31 21:14:49 -07:00
Johnnie Birch
e519fca61c Refactor and turn on lowering for extend-add-pairwise 2021-07-31 10:52:39 -07:00
Johnnie Birch
e373ddfe1b Add extend-add-pairwise instructions x64 2021-07-30 15:06:58 -07:00
Andrew Brown
26c78c06ef refactor: remove unused field
PR #3131 fixed the failing builds by allowing this field to be dead.
After looking at it further the field is not being used and can be
removedi completely.
2021-07-30 10:58:37 -07:00
Alex Crichton
4632b6a816 Fix warning on new-stable (#3131)
One of the fields of `TargetIsa` isn't used in the
cranelift-codegen-meta crate, but instead of refactoring to try to
remove it this just adds `#[allow(dead_code)]` for now in the assumption
that when the old backends go away this will probably go away as well.
2021-07-30 11:13:21 -05:00
Chris Fallin
535b3a47ee Merge pull request #3126 from jlb6740/int-to-int-extend
Add x64 support for remaining int-to-int extend simd instructions
2021-07-29 09:49:22 -07:00
Shamil
072d5dc978 Fix typo in doc (#3127) 2021-07-29 08:59:41 -05:00
Johnnie Birch
4f601edc36 Add x64 support for remaining int-to-int extend simd instructions
Adds remaming support for int to int extend simd instructions.
Specifically adds support for remaining I32x4->I64x2 instructions
2021-07-28 23:33:42 -07:00
Andrew Brown
e3c56efd3e Fix unused borrow warning
`#[warn(unused_must_use)]` is on, prompting a compiler warning like:
"unused borrow that must be used".
2021-07-28 15:39:45 -07:00
Chris Fallin
323197ea93 Merge pull request #3070 from sparker-arm/simd-extmul-aarch64
Enable simd_extmul_* for AArch64
2021-07-28 11:10:57 -07:00
Sam Parker
5eb2dca9f1 Added doc comment
And removed an accidental code move.

Copyright (c) 2021, Arm Limited.
2021-07-28 13:14:20 +01:00
Sam Parker
f2806a9192 rebase and ran cargo fmt
Copyright (c) 2021, Arm Limited.
2021-07-28 13:14:20 +01:00
Sam Parker
541a4ee428 Enable simd_extmul_* for AArch64
Lower simd_extmul_[low/high][signed/unsigned] to [s|u]widen inputs to
an imul node.

Copyright (c) 2021, Arm Limited.
2021-07-28 13:14:20 +01:00
Alex Crichton
65378422bf Add a wasmtime_linker_define_func C API function (#3122)
This exposes the functionality of the `Linker` type where a
store-independent function can be created and inserted, allowing a
linker's functions to be used across many stores (instead of requiring
one linker-per-store).

Closes #3110
2021-07-27 18:56:52 -05:00
Alex Crichton
9b088756b3 Implement Linker::module_async (#3121)
This implements and adds the async counterpart of the `Linker::module`
method.

Closes #3077
2021-07-27 16:17:45 -05:00
Alex Crichton
b5f7b2f86a Remove thread local for mach port (#3119)
This was needed a long time ago in the original implementation when the
function being called here was hotter than it was before, but nowadays
this function isn't hot as it's protected elsewhere from being
repeatedly called, so the caching thread local is no longer necessary.
2021-07-27 11:07:15 -05:00
Chris Fallin
8545ca9cda Merge pull request #3114 from jlb6740/implement_simd_i32x4_trunc_sat_f64x2_for_x64
Implement simd i32x4 trunc sat f64x2 for x64
2021-07-27 08:53:44 -07:00
Dan Gohman
784a380e5f Add comments about vmctx pointers in various datastructures. (#2925)
This forward-ports the relevant parts of #1396.
2021-07-27 09:33:27 -05:00
Johnnie Birch
500f530322 Add support for i32x4_trunc_sat_f64x2_s for x64 2021-07-26 22:24:30 -07:00
Johnnie Birch
23290f0450 Add support for i32x4_trunc_sat_f64x2_u for x64 2021-07-26 22:24:30 -07:00
Johnnie Birch
5deda27977 Add support for Saturating Rounding Q-format Multiplication for x64 2021-07-26 20:32:46 -07:00
Johnnie Birch
ffec1f9b41 Fix for 3089 X64 ext_mul_i8x16 has incorrect lowering
Also factors out unnecessary temp register
2021-07-26 20:06:43 -07:00
Andrew Brown
766774e1f5 refactor: reorganize crate imports 2021-07-26 13:39:16 -07:00
Andrew Brown
961c9ea909 test: check unaligned load-coalescing with SIMD operations 2021-07-26 13:39:16 -07:00
Andrew Brown
6b86984c41 x64: avoid load-coalescing SIMD operations with non-aligned loads
Fixes #2943, though not as optimally as may be desired. With x64 SIMD
instructions, the memory operand must be aligned--this change adds that
check. There are cases, however, where we can do better--see #3106.
2021-07-26 13:39:16 -07:00
Nick Fitzgerald
a2cfddff9c Merge pull request #3116 from fitzgen/update-gimli-and-addr2line
Update `gimli` to 0.25; `addr2line` to 0.16
2021-07-26 13:01:37 -07:00
Chris Fallin
0f068ac933 Merge pull request #3117 from fitzgen/log-levels
cranelift: Move most debug-level logs to the trace level
2021-07-26 12:52:39 -07:00
Nick Fitzgerald
10eead18c8 Update object to 0.26.0 2021-07-26 12:10:41 -07:00
Nick Fitzgerald
514bbb20b4 Update backtrace to 0.3.61 2021-07-26 12:05:44 -07:00
Nick Fitzgerald
4283d2116d cranelift: Move most debug-level logs to the trace level
Cranelift crates have historically been much more verbose with debug-level
logging than most other crates in the Rust ecosystem. We log things like how
many parameters a basic block has, the color of virtual registers during
regalloc, etc. Even for Cranelift hackers, these things are largely only useful
when hacking specifically on Cranelift and looking at a particular test case,
not even when using some Cranelift embedding (such as Wasmtime).

Most of the time, when people want logging for their Rust programs, they do
something like:

    RUST_LOG=debug cargo run

This means that they get all that mostly not useful debug logging out of
Cranelift. So they might want to disable logging for Cranelift, or change it to
a higher log level:

    RUST_LOG=debug,cranelift=info cargo run

The problem is that this is already more annoying to type that `RUST_LOG=debug`,
and that Cranelift isn't one single crate, so you actually have to play
whack-a-mole with naming all the Cranelift crates off the top of your head,
something more like this:

    RUST_LOG=debug,cranelift=info,cranelift_codegen=info,cranelift_wasm=info,...

Therefore, we're changing most of the `debug!` logs into `trace!` logs: anything
that is very Cranelift-internal, unlikely to be useful/meaningful to the
"average" Cranelift embedder, or prints a message for each instruction visited
during a pass. On the other hand, things that just report a one line statistic
for a whole pass, for example, are left as `debug!`. The more verbose the log
messages are, the higher the bar they must clear to be `debug!` rather than
`trace!`.
2021-07-26 11:50:16 -07:00
Nick Fitzgerald
3d76cbdf34 Update gimli to 0.25; addr2line to 0.16 2021-07-26 11:04:53 -07:00
Peter Huene
6f3adacb9f Merge pull request #3113 from peterhuene/doc-limits
Add more documentation to `ModuleLimits` and `InstanceLimits`.
2021-07-23 16:46:13 -07:00
Peter Huene
ad054c6bce Add more documentation to ModuleLimits and InstanceLimits.
This commit adds some clarifying documentation to both the `ModuleLimits` and
`InstanceLimits` types in the Wasmtime API.

It clarifies how each setting relates to the memory allocated by the pooling
instance allocator.

Closes #3080.
2021-07-23 14:26:48 -07:00
Afonso Bordado
a2fb019ba7 cranelift: Add basic i128 support in interpreter 2021-07-23 11:22:07 -07:00
Afonso Bordado
084383f60a cranelift: Add support for i128 values in DataValue 2021-07-23 11:22:07 -07:00
Afonso Bordado
df48798396 cranelift: Emit a trap when dividing by zero in interpreter
Fixes #3058
2021-07-22 10:43:54 -07:00
Afonso Bordado
6be4441bbf cranelift: Resolve alias lookups in interpreter 2021-07-22 10:42:29 -07:00
Andrew Brown
4deed8fe50 refactor: move Wasm test files to tests/all/cli_tests
Previously the inputs to `tests/all/cli_tests.rs` were contained in
`tests/wasm`. This change moves them to the more obvious
`tests/all/cli_tests` directory and updates the paths that point to
them.
2021-07-21 16:17:16 -07:00
Nick Fitzgerald
3309b1a684 Merge pull request #3104 from fitzgen/some-api-docs
Some api docs
2021-07-21 13:11:45 -07:00
Nick Fitzgerald
f136f73033 Reword get_export mutable context docs to be more user-facing 2021-07-21 11:25:49 -07:00