Commit Graph

6536 Commits

Author SHA1 Message Date
Alex Crichton
a92a31d850 Rename the master branch to main (#1924)
* This PR is against a branch called `main`
* Internally all docs/CI/etc is updated
* The default branch of the repo is now `main`
* All active PRs have been updated to retarget `main`

Closes #1914
2020-06-25 14:03:21 -05:00
Nick Fitzgerald
c91a9313b5 Merge pull request #1921 from fitzgen/cargo-fuzz-0.8
CI: use `cargo fuzz` 0.8.X
2020-06-25 10:49:25 -07:00
Nick Fitzgerald
ab80107dfb CI: use cargo fuzz 0.8.X
It has switched to release+debug assertion builds by default, so pass `--dev` to
avoid compiling with optimizations.
2020-06-25 10:01:23 -07:00
Pat Hickey
cd7fcf480b Merge pull request #1910 from bytecodealliance/pch/separate_wasmtime_wiggle_crate
Factor Wiggle's wasmtime integration into a standalone crate
2020-06-25 09:34:34 -07:00
Benjamin Bouvier
c9a3f05afd machinst x64: implement calls and int cmp/store/loads;
This makes it possible to run a simple recursive fibonacci function in
wasmtime.
2020-06-25 16:20:33 +02:00
Johnnie Birch
2d364f75bd Remove xmm_r_r inst data structure and cases after related refactoring
Removes unneeded data structure that was holding instructions for
xmm based move instructions. These instructions can should be categorized
as rm not just r. This change is intended to simplify organization and
cases when lowering.
2020-06-25 14:31:51 +02:00
Pat Hickey
82c4132700 simpler name, add rustdocs 2020-06-24 14:34:35 -07:00
Pat Hickey
6b62b16c7d rewrite shim func generator with witx CoreType 2020-06-24 12:47:28 -07:00
Johnnie Birch
f2f7706265 Implements vcode lowering for f32.copysign.
This patch implements the required but not already available
x64 instructions for copysign as well as the actual lowering sequence
and tests for the newly implemented x64 instructions.
Those instructions include:

andps,
andnps,
movaps,
movd,
orps,

The lowering sequence is based on the lowering for f32.copysign
in the current cranelift backend. movd does not have a test yet
due to some logic needed express a 32-bit register as a source
for xmm_rm_r instructions. This code also begins some
rethinking/refactoring of how the sse move instuctions
are written and so also includes new emit cases that will replace
current ones that match a different enum used to describe sse moves.
2020-06-24 11:47:26 -07:00
Nick Fitzgerald
1ea2f47d9c Merge pull request #1901 from fitzgen/ref-func
Support for `funcref`s, `ref.func`, and `table.grow` with `funcref`s
2020-06-24 10:53:19 -07:00
Nick Fitzgerald
58bb5dd953 wasmtime: Add support for func.ref and table.grow with funcrefs
`funcref`s are implemented as `NonNull<VMCallerCheckedAnyfunc>`.

This should be more efficient than using a `VMExternRef` that points at a
`VMCallerCheckedAnyfunc` because it gets rid of an indirection, dynamic
allocation, and some reference counting.

Note that the null function reference is *NOT* a null pointer; it is a
`VMCallerCheckedAnyfunc` that has a null `func_ptr` member.

Part of #929
2020-06-24 10:08:13 -07:00
Pat Hickey
91980b29f7 Merge pull request #1909 from siyopao/guestptr-conversion
wiggle: GuestPtr<[u8]> => GuestPtr<str> conversions
2020-06-23 21:08:44 -07:00
Pat Hickey
c6e599219a Update crates/wiggle/src/lib.rs 2020-06-23 21:08:05 -07:00
Pat Hickey
67f6aad415 Update crates/wiggle/src/lib.rs 2020-06-23 21:08:00 -07:00
Pat Hickey
564b0709dd wip 2020-06-23 18:11:38 -07:00
Pat Hickey
f66c1fbde9 reorganize configuration into modules 2020-06-23 17:42:12 -07:00
Craig Pastro
ea3c2325a5 wiggle: add as_byte_ptr: str -> [u8] method 2020-06-24 09:12:30 +09:00
Craig Pastro
7699c4d6e3 wiggle: fix lifetime in as_str_ptr 2020-06-24 09:10:59 +09:00
Nick Fitzgerald
ddc2ce8080 cranelift-wasm: Make FuncEnvironment::translate_ref_func take a FuncIndex
It was previously taking a raw `u32`. This change makes it more clear what index
space that index points into.
2020-06-23 16:36:10 -07:00
Nick Fitzgerald
c6f32f666d cranelift-wasm: Retain both the Wasm and Cranelift types of tables 2020-06-23 16:36:10 -07:00
Nick Fitzgerald
03165e0cb5 cranelift-wasm: Allow more customization of ref type representations
* Allow different Cranelift IR types to be used for different Wasm reference
  types.

* Do not assume that all Wasm reference types are always a Cranelift IR
  reference type. For example, `funcref`s might not need GC in some
  implementations, and can therefore be represented with a pointer rather than a
  reference type.
2020-06-23 16:36:10 -07:00
Nick Fitzgerald
28fccaedc4 cranelift-wasm: Pass ir::Tables into all the translate_table_* methods
This serves two purposes:

1. It ensures that we call `get_or_create_table` to ensure that the embedder
already had a chance to create the given table (although this is mostly
redundant due to validation).

2. It allows the embedder to easily get the `ir::TableData` associated with this
table, and more easily emit whatever inline JIT code to translate the table
instruction (rather than falling back to VM calls).
2020-06-23 16:36:10 -07:00
Pat Hickey
69f81397a8 add func overrides, to get rid of proc exit special case 2020-06-23 16:29:11 -07:00
Pat Hickey
49c62ee828 make the missing memory error value configurable 2020-06-23 15:28:01 -07:00
Pat Hickey
62237de7ce remove logging: wiggle now provides this functionality 2020-06-23 14:49:17 -07:00
Pat Hickey
bb339aaba0 rename macro. add comments to invocation. 2020-06-23 14:16:53 -07:00
Pat Hickey
abc3982234 add target to config 2020-06-23 14:13:27 -07:00
Thibault Charbonnier
8082aeaa5f C API: expose wasmtime_linker_get_one_by_name() (#1897)
* C API: expose wasmtime_linker_get_one_by_name()

* C API: remove unnecessary 'unsafe' qualifiers

* C API: avoid unnecessary mutable borrows of the Linker
2020-06-23 14:23:49 -05:00
Chris Fallin
9751b96c5e Merge pull request #1900 from cfallin/clarify-lowering-docs
MachInst isel and aarch64 backend: docs / clarity improvements.
2020-06-23 09:59:07 -07:00
Alex Crichton
6f6296816b Bind Trap::i32_exit_status in C API (#1912)
This allows embedders to take a different action when a WASI program
exits depending on whether it exited with an exit status or exited with
a trap.

cc bytecodealliance/wasmtime-py#30
2020-06-23 11:40:51 -05:00
Pat Hickey
cde32070fc factor the docs out as well 2020-06-22 19:27:31 -07:00
Pat Hickey
6adbae3007 paramaterize the instance type name as well 2020-06-22 19:01:29 -07:00
Pat Hickey
09971bc090 replace more custom idents with Names 2020-06-22 18:54:07 -07:00
Pat Hickey
1050c6d99c wasmtime-wiggle-macro: re-use Names functionality
rather than try to duplicate it in utils
2020-06-22 18:47:59 -07:00
Pat Hickey
185701df1b wasmtime-wiggle-macro: adopt config system from wiggle-generate 2020-06-22 18:39:33 -07:00
Pat Hickey
7d3d16aef0 wig: delete wiggle integration functionality 2020-06-22 17:24:53 -07:00
Pat Hickey
303f7172a1 wasi: switch to use wasmtime-wiggle for wiggle integration 2020-06-22 17:23:11 -07:00
Pat Hickey
712990191a create wasmtime-wiggle crate, by copying implementation of wig 2020-06-22 17:23:06 -07:00
Craig Pastro
cf8cf9a948 wiggle: fix a couple of typos in lib.rs docs 2020-06-23 08:47:13 +09:00
Craig Pastro
f9ef734698 wiggle: GuestPtr<[u8]> => GuestPtr<str> conversions 2020-06-23 08:46:40 +09:00
Benjamin Bouvier
60ac091afe Remove unused dependencies in Cranelift; 2020-06-22 08:45:09 -07:00
Peter Huene
f4e3e4efde Merge pull request #1899 from AlexEne/master
Fix compilation error due to redefinition.
2020-06-18 22:59:50 -07:00
Alexandru Ene
38f4ed084d Don't reuse the command between c/c++ 2020-06-19 00:14:29 +01:00
Benjamin Bouvier
4f6a002f70 cranelift-filetests: tell when a run test is skipped (fixes #1558); 2020-06-18 16:11:21 -07:00
Alexandru Ene
9213717917 Run cc tests if any are found in the examples folder 2020-06-19 00:09:33 +01:00
Chris Fallin
492000e945 MachInst isel and aarch64 backend: docs / clarity improvements.
From discussion with Julian and Ben, this PR makes a few documentation-
and naming-level changes (no functionality change):

- Document that the `LowerCtx`-provided output register can be used as a
  scratch register during the lowered instruction sequence before
  placing the final result in it.

- Rename `input_to_*` helpers in the AArch64 backend to
  `put_input_in_*`, emphasizing that these are side-effecting helpers
  that potentially generate code (e.g., sign/zero-extensions) to ensure
  an input value is in a register.
2020-06-18 12:18:50 -07:00
Chris Fallin
f84903fa43 Merge pull request #1892 from akirilov-arm/simd_fp_cmp
AArch64: Implement SIMD floating-point comparisons
2020-06-18 12:17:09 -07:00
Alexandru Ene
65e132db0c Added a hello.cc 2020-06-18 19:48:18 +01:00
Andrew Brown
6c05590104 Translate Wasm's i32x4.trunc_sat_f32x4_s instruction to Cranelift's fcvt_to_sint_sat 2020-06-18 11:39:38 -07:00
Andrew Brown
3675f95bb2 Legalize fcvt_to_sint_sat.i32x4 on x86
Use a lengthy sequence involving CVTTPS2DQ to quiet NaNs and saturate overflow.
2020-06-18 11:39:38 -07:00