Commit Graph

6452 Commits

Author SHA1 Message Date
Chris Fallin
dfb7a86d7a Merge pull request #1834 from cfallin/module-translation-state-multivalue
Allow ModuleTranslationState to be constructed with signatures.
2020-06-08 12:59:59 -07:00
whitequark
3796164642 x86_32: legalize br{z,nz}.i64. 2020-06-08 12:52:13 -07:00
Chris Fallin
31b8e5695c Merge pull request #1833 from cfallin/multi-value-loop
Wasm translator multi-value bugfix: handle branch to loop with loop parameters.
2020-06-08 12:21:00 -07:00
Chris Fallin
59307625c8 Allow ModuleTranslationState to be constructed with signatures.
This is needed to allow SpiderMonkey to provide function signature types
to the wasm translator when it uses Cranelift as a backend without
using the wasm translator to parse the entire module. There is perhaps a
better long-term design here where we allow an embedding that already
parses the Wasm module (such as SpiderMonkey) to provide information in
a more principled way, this suffices for now.

Patch is inspired by Ben's patch in
https://bugzilla.mozilla.org/show_bug.cgi?id=1641504, but does not
expose `wasmparser` types directly, instead using Cranelift types across
the API boundary.
2020-06-08 12:19:15 -07:00
Maciej Woś
7ab5f2a869 Remove custom signal handler restrictions (#1843)
* remove custom signal handler origin restriction

* add a test for handling signals from a hostcall

* cargo fmt
2020-06-08 12:33:28 -05:00
Chris Fallin
cc8630d9b4 Wasm translator multi-value bugfix: handle branch to loop with loop params. 2020-06-05 17:29:15 -07:00
Chris Fallin
4bb58940c7 Merge pull request #1830 from cfallin/update-qemu
Update from qemu 4.2.0 to qemu 5.0.0 for emulation-based CI jobs.
2020-06-05 13:27:45 -07:00
Chris Fallin
5c7e6e6e9a Update from qemu 4.2.0 to qemu 5.0.0 for emulation-based CI jobs. 2020-06-05 12:52:00 -07:00
whitequark
bc555468a7 cranelift: add i64.{ishl,ushr,ashr} libcalls.
These libcalls are useful for 32-bit platforms.

On x86_32 in particular, commit 4ec16fa0 added support for legalizing
64-bit shifts through SIMD operations. However, that legalization
requires SIMD to be enabled and SSE 4.1 to be supported, which is not
acceptable as a hard requirement.
2020-06-05 12:13:49 -07:00
bjorn3
be20c92205 Correct version of region dependency of simplejit (#1827) 2020-06-05 09:27:06 -05:00
Chris Fallin
00abfcd943 Merge pull request #1817 from cfallin/issue-1809
Avoid touching encodings in `EncCursor` if using a MachInst backend.
2020-06-04 12:50:39 -07:00
Yury Delendik
6f37204f82 Upgrade gimli to 0.21 (#1819)
* Use gimli 0.21

* rm CFI w Expression

* Don't write .debug_frame twice
2020-06-04 14:34:05 -05:00
Andrew Brown
97c7fbbeb6 Update Wasm spec testsuite 2020-06-04 12:19:41 -07:00
Chris Fallin
63a335b7d4 Avoid touching encodings in EncCursor if using a MachInst backend.
`EncCursor` is a variant of `Cursor` that allows updating CLIF while
keeping its encodings up to date, given a particular ISA. However, new
(MachInst) backends don't use the encodings, and the `TargetIsaAdapter`
shim will panic if any encoding-related method is called. This PR avoids
those panics.

Fixes #1809.
2020-06-04 10:53:45 -07:00
Pat Hickey
3de418630a Merge pull request #1796 from bytecodealliance/pch/wiggle_tracing
wiggle: switch logging to use `tracing` crate
2020-06-04 09:44:23 -07:00
Alex Crichton
5a8afd4540 Pin nightlies to fix lightbeam compilation (#1818)
Looks like lightbeam's nightly dependencies don't compile on the most
recent nightly. For now let's pin nightlies to get CI green.
2020-06-04 11:32:49 -05:00
Leonardo Yvens
cd4a441d88 impl WasmTy for u32 and u64 (#1808)
* impl WasmTy for u32 and u64

* docs: Update Rust to wasm type table
2020-06-04 09:00:49 -05:00
Pat Hickey
54694b8d0e Merge pull request #1810 from Kong/fix/test-programs-tagged-unions
fix(tagged-union): changed test programs to use new tagged union
2020-06-03 17:28:48 -07:00
Pat Hickey
2e952b72d0 Merge pull request #1816 from bytecodealliance/pch/faerie_deprecation
Add deprecation notice to cranelift-faerie README and FaerieBuilder.
2020-06-03 17:28:04 -07:00
Andrew Brown
5db384cd76 Rename opcode: PMULLQ to VPMULLQ 2020-06-03 16:27:57 -07:00
Andrew Brown
ce78ee3b32 Enable SIMD spec test for i64x2 arithmetic 2020-06-03 16:27:57 -07:00
Andrew Brown
aa44e8b2e3 Translate Wasm's I64x2Mul to Cranelift's imul.i64x2 2020-06-03 16:27:57 -07:00
Andrew Brown
1ea09088be Add x86 legalization for imul.i64x2 for non-AVX CPUs
The `convert_i64x2_imul` custom legalization checks the ISA flags for AVX512DQ or AVX512VL support and legalizes `imul.i64x2` to an `x86_pmullq` in this case; if not, it uses a lengthy SSE2-compatible instruction sequence.
2020-06-03 16:27:57 -07:00
Andrew Brown
b3a6985cd5 Re-organize transform groups for x86 legalization 2020-06-03 16:27:57 -07:00
Andrew Brown
5a32500518 Remove non-existent x86 encoding for sshr_imm.i64x2
This instruction does not exist in the SSE2 feature set; it can be added later with an VEX/EVEX encoding.
2020-06-03 16:27:57 -07:00
Andrew Brown
df171f01b5 Add x86_pmuludq
This instruction multiplies the lower 32 bits of two 64x2 unsigned integers into an i64x2; this is necessary for lowering Wasm's i64x2.mul.
2020-06-03 16:27:57 -07:00
Andrew Brown
40f31375a5 Add TargetIsa::as_any for downcasting to specific ISA implementations
This is necessary when we would like to check specific ISA flags, e.g.
2020-06-03 16:27:57 -07:00
Andrew Brown
9ba9fd0f64 Add x86-specific instruction for i64x2 multiplication
Without this special instruction, legalizing to the AVX512 instruction AND the SSE instruction sequence is impossible. This extra instruction would be rendered unnecessary by the x64 backend.
2020-06-03 16:27:57 -07:00
Pat Hickey
fe92a8da48 Add deprecation notice to cranelift-faerie README and FaerieBuilder. 2020-06-03 16:20:46 -07:00
Emiliano Lesende
ef4ff71dc5 fix(tagged-union): updated Cargo.lock 2020-06-03 20:00:59 -03:00
Pat Hickey
0fb374947a code review comments 2020-06-03 15:35:53 -07:00
Emiliano Lesende
59ee430431 fix(tagged-union): rebase and squash
fix(tagged-union): changed test programs to use new tagged union
generated code

fix(tagged-union): changed test programs to use new tagged union generated code

fix(tagged-union): removed local dependency and changed to point to 0.9.1 version of wasi

fix(tagged-union): added newline to gitignore, changed wasi version to 0.10.0

fix(tagged-union): removed gitignore as Cargo.lock is intentional
2020-06-03 19:07:02 -03:00
Hiroki Noda
8701645493 Fix comment for running example fib-debug (#1814) 2020-06-03 16:17:48 -05:00
Chris Fallin
5078e4eba2 Merge pull request #1774 from cfallin/aarch64-multivalue
Multi-value return support on aarch64/Wasmtime.
2020-06-03 14:14:38 -07:00
Chris Fallin
fe97659813 Address review comments. 2020-06-03 13:31:34 -07:00
Chris Fallin
615362068f Multi-value return support. 2020-06-03 13:31:34 -07:00
Chris Fallin
34eb170232 Merge pull request #1811 from cfallin/fix-warning
Fix build warnings (errors on CI) due to mmap flag rename and deprecation.
2020-06-03 13:26:36 -07:00
Yury Delendik
1f86bcfb27 freeze gimli 2020-06-03 12:47:01 -07:00
Pat Hickey
6910c1e03d use tracing 0.1.15 release 2020-06-03 10:54:52 -07:00
Pat Hickey
220733b974 wiggle-generate: add an empty constructor to ErrorTransform
some library users (me, in lucet-wasi) may not care about ErrorTransform YET
2020-06-03 10:54:34 -07:00
Pat Hickey
dcb774a35e temporarily use tracing from git 2020-06-03 10:54:34 -07:00
Pat Hickey
1b95b24686 show env_logger working in wiggle tracing example 2020-06-03 10:54:17 -07:00
Pat Hickey
33a94ca7d5 just one cargo feature for tracing/log 2020-06-03 10:54:17 -07:00
Pat Hickey
820b283cf8 can't put tracing behind a feature without an extra crate :( 2020-06-03 10:54:17 -07:00
Pat Hickey
02c0c68ed2 replace all uses of log with tracing 2020-06-03 10:53:55 -07:00
Pat Hickey
f89fc0ac57 wiggle: can swap in tracing for args 2020-06-03 10:53:32 -07:00
Pat Hickey
994104d615 wiggle: add config options for logging 2020-06-03 10:53:32 -07:00
Chris Fallin
b8e31d7c8e Fix build warnings (errors on CI) due to mmap flag rename and deprecation. 2020-06-03 09:48:22 -07:00
Dan Gohman
a76639c6fb Wasmtime 0.17.0 and Cranelift 0.64.0. (#1805) 2020-06-02 18:51:59 -07:00
Yury Delendik
15c68f2cc1 Disconnects Store state fields from Compiler (#1761)
*  Moves CodeMemory, VMInterrupts and SignatureRegistry from Compiler
*  CompiledModule holds CodeMemory and GdbJitImageRegistration
*  Store keeps track of its JIT code
*  Makes "jit_int.rs" stuff Send+Sync
*  Adds the threads example.
2020-06-02 13:44:39 -05:00