Commit Graph

8795 Commits

Author SHA1 Message Date
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
Nick Fitzgerald
943d027757 Document reborrowing issues for AsContextMut and workarounds 2021-07-21 09:28:36 -07:00
Nick Fitzgerald
4c9f90e89d Document why get_export requires a mutable context 2021-07-21 09:10:09 -07:00
Afonso Bordado
065190f975 cranelift: Implement br_table on the interpreter 2021-07-20 15:31:27 -07:00
Pat Hickey
ebbe399725 wasi tutorial: make usage string consistient between rust and c programs (#3098)
closes #3093
2021-07-19 15:04:33 -05:00
Alex Crichton
c8950cf842 Update nightly toolchains in CI (#3097)
This will hopefully fix CI issues we've been seeing with downloads
2021-07-19 13:20:52 -05:00
Afonso Bordado
3a38400447 aarch64: Refactor lower_icmp to use a single materialize_bool_result 2021-07-19 09:31:14 -07:00
Afonso Bordado
14d1c7ee9f aarch64: Refactor lower_icmp to allow returning a different flag 2021-07-19 09:31:14 -07:00
Afonso Bordado
7526cdc65e cranelift: Use ValueConversionKind in branches 2021-07-19 09:31:14 -07:00
Afonso Bordado
037bd41c67 cranelift: Rename Interpreter overflow method 2021-07-19 09:31:14 -07:00
Afonso Bordado
e628fb376f aarch64: Fix incorrect code generation for overflow icmp in i16 values 2021-07-19 09:31:14 -07:00
Afonso Bordado
04033fe645 cranelift: Implement overflow flags for icmp in interpreter 2021-07-19 09:31:14 -07:00
Afonso Bordado
c42b725ce9 cranelift: Fix br_icmp in interpreter 2021-07-19 09:31:14 -07:00
Afonso Bordado
004af01a88 cranelift: Fix brz,brnz instructions in the interpreter 2021-07-19 09:31:14 -07:00
Pat Hickey
d33f8337b3 Merge pull request #3096 from crab2313/riscv-disassemble
Riscv disassembler support
2021-07-19 09:27:49 -07:00
Qiu Wenbo
eafd10c1e8 Disassembler support for RV32/64 2021-07-19 18:20:20 +08:00
Qiu Wenbo
f628d06118 Upgrade capstone to v0.9 2021-07-19 17:14:28 +08:00
Afonso Bordado
db5566dadb aarch64: Fix lowering amounts for shifts
This commit addresses two issues:
* A panic when shifting any non i128 type by i128 amounts (#3064)
* Wrong results when lowering shifts with small types (i8, i16)

In these types when shifting for amounts larger than the size of the
type, we would not get the wrapping behaviour that we see on i32 and i64.
This is because in these larger types, the wrapping behaviour is automatically
implemented by using the appropriate instruction, however we do not
have i8 and i16 specific instructions, so we have to manually wrap
the shift amount with an AND instruction.

This issue is also found on x86_64 and s390x, and a separate issue will
be filed for those.

Closes #3064
2021-07-16 22:08:02 +01:00
Anton Kirilov
6c3d7092b9 Enable the simd_conversions test for AArch64
Copyright (c) 2021, Arm Limited.
2021-07-16 22:04:45 +01:00
Alex Crichton
ff1ae6e10c Flag another error as ok to hit when fuzzing (#3092)
We've got a lot of fuzz failures right now of modules instantiating
memories of 65536 pages, which we specifically disallow since the
representation of limits within Wasmtime don't support full 4GB
memories. This is ok, however, and it's not a fuzz failure that we're
interested in, so this commit allows strings of that error to pass
through the fuzzer.
2021-07-16 14:37:27 -05:00
Pat Hickey
83f7872ace Merge pull request #3090 from bytecodealliance/pch/wiggle_dummy_executor_crashes
wiggle: dummy executor traps instead of panics, improve testing
2021-07-16 11:34:56 -07:00
Pat Hickey
906182a304 fix wasi-tokio 2021-07-16 10:28:09 -07:00