Commit Graph

6898 Commits

Author SHA1 Message Date
Johnnie Birch
0b67b22eda Update renamed document lint for broken links
Renames intra_doc_link_resolution_failure to broken_intra_doc_links
2020-08-20 14:24:06 -07:00
Andrew Brown
2154b76fa8 machinst x64: enable simd_const.wast spec test 2020-08-20 12:37:22 -07:00
Andrew Brown
2767b2efc6 machinst x64: add Inst::[move|load|store] for choosing the correct x86 instruction
This change primarily adds the ability to lower packed `[move|load|store]` instructions (the vector types were previously unimplemented), but with the addition of the utility `Inst::[move|load|store]` functions it became possible to remove duplicated code (e.g. `stack_load` and `stack_store`) and use these utility functions elsewhere (though not exhaustively).
2020-08-20 12:37:22 -07:00
Andrew Brown
cf598dc35b machinst x64: add packed moves for different vector types 2020-08-20 12:37:22 -07:00
Chris Fallin
debacec1c5 Merge pull request #2150 from jgouly/mul64s
arm64: Implement SIMD i64x2 multiply
2020-08-20 11:57:56 -07:00
Chris Fallin
051feaad75 Merge pull request #2148 from bjorn3/aarch64_fix_put_input_in_rsa
Fix put_input_in_reg
2020-08-20 11:41:35 -07:00
Chris Fallin
775dfa9df2 Merge pull request #1520 from bjorn3/aarch64-lower-small-fcvt_from_int
Lower fcvt_from_{u,s}int for 8 and 16 bit ints
2020-08-20 11:35:06 -07:00
Joey Gouly
a518c10141 arm64: Implement SIMD i64x2 multiply
Copyright (c) 2020, Arm Limited.
2020-08-20 13:26:03 +01:00
Alex Crichton
693c6ea771 wasmtime: Extract cranelift/lightbeam compilers to separate crates (#2117)
This commit extracts the two implementations of `Compiler` into two
separate crates, `wasmtime-cranelfit` and `wasmtime-lightbeam`. The
`wasmtime-jit` crate then depends on these two and instantiates them
appropriately. The goal here is to start reducing the weight of the
`wasmtime-environ` crate, which currently serves as a common set of
types between all `wasmtime-*` crates. Long-term I'd like to remove the
dependency on Cranelift from `wasmtime-environ`, but that's going to
take a lot more work.

In the meantime I figure it's a good way to get started by separating
out the lightbeam/cranelift function compilers from the
`wasmtime-environ` crate. We can continue to iterate on moving things
out in the future, too.
2020-08-20 11:34:31 +02:00
bjorn3
957eb9eeba Less unnecessary zero and sign extensions 2020-08-20 10:17:04 +02:00
bjorn3
b5e24c8c67 Update object to 0.21.1 (#2144) 2020-08-19 15:14:26 -05:00
bjorn3
ba48b9aef1 Fix put_input_in_reg 2020-08-19 19:38:47 +02:00
Gabor Greif
4cafb90186 use opcode directly, now that we support this (#2145)
fixing also two typos with `DW_OP_fbreg`
2020-08-19 12:30:01 -05:00
Johnnie Birch
a31336996c Add support for some packed multiplication for new x64 backend
Adds support for i32x4, and i16x8 and lowering for pmuludq in
preperation for i64x2.
2020-08-19 10:24:14 -07:00
bjorn3
3a16416132 Add tests 2020-08-19 19:17:27 +02:00
bjorn3
4a84f3f073 Lower fcvt_from_{u,s}int for 8 and 16 bit ints 2020-08-19 18:07:12 +02:00
Pat Hickey
81b3450114 Merge pull request #2141 from bytecodealliance/pch/cranelift_faerie_deprecated
delete cranelift-faerie
2020-08-18 13:00:32 -07:00
Chris Fallin
924782191b Merge pull request #2138 from cfallin/regalloc-v0.0.30
Use regalloc 0.0.30.
2020-08-18 11:46:39 -07:00
Pat Hickey
35c100fdca delete cranelift-faerie
see https://github.com/bytecodealliance/wasmtime/pull/1816

DEPRECATION NOTICE: the Cranelift developer team intends to stop maintaining
the `cranelift-faerie` crate and remove it from the `wasmtime` git repository
on or after August 3, 2020. We recommend users use its successor, the
`cranelift-object` crate.
2020-08-18 11:02:14 -07:00
Chris Fallin
22181d0819 Use regalloc 0.0.30.
This upgrade pulls in one memory-allocation reduction improvement
(bytecodealliance/regalloc.rs#95). There should be no change in behavior
as a result of this.
2020-08-18 09:51:35 -07:00
Gabor Greif
30b9e69136 don't leave Deref bytecode for Code chunk (#2137)
Re-enter loop after pushing `CompiledExpressionPart::Deref`, so that it
isn't recoded for `CompiledExpressionPart::Code` as well.
2020-08-18 10:54:34 -05:00
Chris Fallin
7c1cd774ef Merge pull request #2134 from cfallin/fix-abi-extension
AArch64 ABI: properly store full 64-bit width of extended args/retvals.
2020-08-18 08:39:30 -07:00
Nick Fitzgerald
4f7b10acac Merge pull request #2135 from bytecodealliance/pch/wasi_dep_version_gardening
Dependency version gardening
2020-08-17 16:39:31 -07:00
Pat Hickey
bacf470a3e bump all wat dependencies to 1.0.23
this gets us down to one version of `wast` in dependency tree!
2020-08-17 16:03:35 -07:00
Pat Hickey
a8ecb451f1 wasmtime-wast: bump wast dependency to 22.0.0 2020-08-17 15:58:56 -07:00
Pat Hickey
19e2a46aaf bump to latest wasi submodule
witx is now 0.8.6.
2020-08-17 15:58:56 -07:00
Chris Fallin
5fa0be3515 AArch64 ABI: properly store full 64-bit width of extended args/retvals.
When storing an argument to a stack location for consumption by a
callee, or storing a return value to an on-stack return slot for
consumption by the caller, the ABI implementation was properly extending
the value but was then performing a store with only the original width.
This fixes the issue by always performing a 64-bit store of the extended
value.

Issue reported by @uweigand (thanks!).
2020-08-17 15:00:04 -07:00
Alex Crichton
7fdbd081e6 Switch back to nightly channel for testing (#2116)
I believe the staticvec issues should be resolved now!
2020-08-17 15:16:12 +02:00
Chris Fallin
ac6539abd7 Merge pull request #2128 from cfallin/machinst-abi-refactor-2
Refactor AArch64 ABI support to extract common bits for shared impl with x64.
2020-08-14 17:08:07 -07:00
Chris Fallin
5cf3fba3da Refactor AArch64 ABI support to extract common bits for shared impl with x64.
We have observed that the ABI implementations for AArch64 and x64 are
very similar; in fact, x64's implementation started as a modified copy
of AArch64's implementation. This is an artifact of both a similar ABI
(both machines pass args and return values in registers first, then the
stack, and both machines give considerable freedom with stack-frame
layout) and a too-low-level ABI abstraction in the existing design. For
machines that fit the mainstream or most common ABI-design idioms, we
should be able to do much better.

This commit factors AArch64 into machine-specific and
machine-independent parts, but does not yet modify x64; that will come
next.

This should be completely neutral with respect to compile time and
generated code performance.
2020-08-14 16:27:39 -07:00
Steve Phillips
a577667f9f Update introduction.md: typo fixes 2020-08-14 11:47:27 -04:00
Chris Fallin
279534e276 Merge pull request #2130 from cfallin/update-regalloc
Upgrade to regalloc 0.0.29.
2020-08-14 08:45:10 -07:00
Pat Hickey
c61469672f Merge pull request #2129 from bytecodealliance/pch/wiggle_doc_fixes
wiggle: doc fixes
2020-08-13 14:24:29 -07:00
Chris Fallin
3b007dd6a2 Upgrade to regalloc 0.0.29.
This upgrade pulls in several recent changes in regalloc that should
improve compile-time performance in the AArch64 and new x64 backends.
2020-08-13 11:40:34 -07:00
Pat Hickey
c268c9e79b wiggle: doc fixes 2020-08-13 11:20:19 -07:00
Johnnie Birch
38ef98700f Adds packed integer subtraction 2020-08-12 09:41:20 -07:00
Nick Fitzgerald
e88d749031 Merge pull request #2123 from alexcrichton/fix-table-error
Update error message for bad table init
2020-08-10 08:58:07 -07:00
Nick Fitzgerald
33a6191909 Merge pull request #2120 from cfallin/wasm-unreachable-if-else-params
Wasm translation bugfix: properly clean up value stack for else-branch when if-branch ends in unreachable.
2020-08-10 08:36:05 -07:00
Nick Fitzgerald
fa82475677 Merge pull request #2122 from alexcrichton/fix-spectests
Fix execution of spectest fuzzer
2020-08-10 08:25:16 -07:00
Alex Crichton
bd8e08fe4a Update error message for bad table init
Although the string description for `TableOutOfBounds` isn't quite
matching what this error case is, it's a bit more descriptive than
`HeapOutOfBounds` anyway.
2020-08-10 06:57:58 -07:00
Alex Crichton
5893317a8e Fix execution of spectest fuzzer
We've enabled bulk memory and reference types by default now which means
that wasmtime in its default settings no longer passes the spec test
suite (due to changes in error messages in initialization), so when
we're running the spec test fuzzer be sure to disable reference types
and bulk memory since that's required to pass.
2020-08-10 06:55:36 -07:00
Chris Fallin
dd5a5ebdbc Wasm translation bugfix: properly clean up value stack for else-branch when if-branch ends in unreachable.
The Wasm translation handles unreachable code sections
specially, skipping ops until the end of a block and a control-flow
merger at which code becomes reachable again. Unfortunately, while the
ordinary else-op handler properly sets up the value stack for the
else-branch with the parameters to the if/else, the unreachable-case
else-op handler did not. This resulted in a bad translation and CLIF
type error despite valid Wasm.

Found via fuzzing by :decoder in
https://bugzilla.mozilla.org/show_bug.cgi?id=1657895.
2020-08-07 18:33:04 -07:00
Nick Fitzgerald
5f36d7eab7 Merge pull request #2118 from fitzgen/enable-ref-types-by-default
Enable ref types and bulk memory operations by default
2020-08-07 17:41:05 -07:00
Nick Fitzgerald
ef13e80bcf docs: Add contributor docs for implementing and enabling new Wasm proposals 2020-08-07 16:54:51 -07:00
Nick Fitzgerald
5647dcbb8f docs: Document and advertise our support for various Wasm proposals 2020-08-07 16:54:51 -07:00
Nick Fitzgerald
47d3c8de52 docs: Better title formatting for the coding guidelines 2020-08-07 16:54:51 -07:00
Nick Fitzgerald
bf16b33739 docs: Use Title Case for the Table of Contents 2020-08-07 16:54:51 -07:00
Nick Fitzgerald
5af47dc4cd cranelift: Only emit stack maps when a function actually uses reference types
This fix avoids a small slow down in scenarios where reference types are enabled
but a given function doesn't actually use them.

Fixes #1883
2020-08-07 16:54:51 -07:00
Nick Fitzgerald
94e4bad1e0 Enable reference types and bulk memory operations by default 2020-08-07 16:54:51 -07:00
Alex Crichton
c7cd70fcec wasmtime: Refactor how imports are resolved (#2102)
This commit removes all import resolution handling from the
`wasmtime-jit` crate, instead moving the logic to the `wasmtime` crate.
Previously `wasmtime-jit` had a generic `Resolver` trait and would do
all the import type matching itself, but with the upcoming
module-linking implementation this is going to get much trickier.

The goal of this commit is to centralize all meaty "preparation" logic
for instantiation into one location, probably the `wasmtime` crate
itself. Instantiation will soon involve recursive instantiation and
management of alias definitions as well. Having everything in one
location, especially with access to `Store` so we can persist
instances for safety, will be quite convenient.

Additionally the `Resolver` trait isn't really necessary any more since
imports are, at the lowest level, provided as a list rather than a map
of some kind. More generic resolution functionality is provided via
`Linker` or user layers on top of `Instance::new` itself. This makes
matching up provided items to expected imports much easier as well.

Overall this is largely just moving code around, but most of the code
in the previous `resolve_imports` phase can be deleted since a lot of it
is handled by surrounding pieces of `wasmtime` as well.
2020-08-07 16:38:01 -05:00