Commit Graph

214 Commits

Author SHA1 Message Date
37be884403 Clean up F32x4DemoteF64x2Zero op in compiler llvm 2021-05-13 08:20:00 -07:00
f8b67c743a Remove REVIEW request comments 2021-05-12 10:14:58 -07:00
1082fe1692 Clean up LLVM SIMD changes 2021-05-12 08:10:54 -07:00
88d2ac9626 Fix bug in I32x4TruncSatF64x2SZero
We need to use LEF64, not LEF32, when dealing with f64s
2021-05-11 14:47:44 -07:00
20297858ed Implement I16x8Q15MulrSatS in compiler LLVM 2021-05-11 14:37:59 -07:00
da86e69a45 Implement all but 2 new SIMD ops in compiler LLVM 2021-05-11 11:14:25 -07:00
2f5f9d9e48 Implement most of the rest of the new SIMD in llvm 2021-05-11 09:49:48 -07:00
17c27f1d15 Implement new SIMD instructions in compiler LLVM 2021-05-07 11:21:13 -07:00
d699e61083 Implement bulk memory instructions in compiler-llvm 2021-05-06 09:07:51 -07:00
06407e327f Remove goblin, use object. 2021-05-03 16:23:48 -07:00
20758ea8af Update wasmparser to 0.77 2021-04-29 09:22:14 -07:00
c634cdcc2e Add TypedSelect support to Singlepass + LLVM
Missed this in the reftypes PR
2021-04-28 10:03:07 -07:00
9be59f809f Use FunctionBinaryReader instead of Middleware 2021-04-26 16:40:54 -07:00
8149453ff5 Merge branch 'master' into feature/reference-types 2021-03-31 08:42:26 -07:00
74a0550101 Fix bug in i64.rotr X 0 in compiler-llvm, add wasmer wast tests 2021-03-26 09:59:46 -07:00
2a541e072b Merge branch 'master' into feature/reference-types 2021-03-16 12:28:05 -07:00
cc27bb2216 Fix some verifier errors in the 64-bit computations. 2021-03-01 15:50:47 -08:00
c422fdeba2 Correct implementation of shift and rotate.
The existing implementations worked on x86-64 when instructions were emitted, but relied on UB per the LLVM IR. Add a test which checks the behaviour when the inputs are constants, so that the LLVM IR constant folder can see and exploit the UB.
2021-03-01 15:00:18 -08:00
40f40bb7d4 RefNull may return any reference type. 2021-03-01 13:40:04 -08:00
3c6168d0bb Split funcref and externref into separate LLVM types, add anyref_ty. 2021-03-01 13:22:56 -08:00
b14afa1342 Implement all reference types instructions in compiler-llvm.
Remove spectest ignores for reference types tests on llvm.

Extend llvm ABIs to pass externref and funcref.

Expose all libcalls through the Libcalls enum.

Add support for all libcalls to llvm object_file.rs, even libcalls that we aren't using.

Add missing no_mangle to libcalls.
Change 'memory' to 'memory32' in libcalls in preparation for the memory64 proposal.
Remove 'local' from 'wasmer_local_memory_copy' in libcalls to fit naming convention.
Add mangling of externref and funcref for llvm-debug-dir.
Mark 'wasmer_func_ref' readonly.
2021-03-01 11:53:12 -08:00
1e777f9a85 Move the test that a table index is in bounds to a point before we deref it.
This fixes the type of trap produced.
2021-02-24 11:19:19 -08:00
6e3f835db8 Merge branch 'master' into feature/reference-types 2021-02-10 06:36:36 -08:00
0a17424368 Update wasmparser and core spectests 2021-02-09 11:57:54 -08:00
6cfcc92d52 Implement further for compiler-cranelift; add ExternRef 2021-02-08 12:49:15 -08:00
ecf891e0ac Add extra layer of indirection for funcref, update tables
This is still a WIP, cranelift is passing spectests but singlepass has 3
failures and LLVM is not implemented correctly
2021-02-03 07:47:25 -08:00
6192143102 NFC. This utility function moved to inkwell. 2021-02-02 12:03:10 -08:00
657d3a52dd Add dereferenceable attribute to the vmctx pointer. 2021-01-27 11:08:13 -08:00
799f1fde66 Add align, nofree and nonnull to vmctx pointer.
Adding dereferenceable is still TODO.
2021-01-26 10:50:50 -08:00
65d8481acf Remove interprocedural optimization passes.
We never have more than one function defined in a module at a time.
2020-12-23 16:25:55 -08:00
271c767785 Replace all usages of to_wasm_error 2020-12-22 09:17:09 +01:00
e7dd725c6d Add module info transformation method to ModuleMiddleware. 2020-11-20 14:34:46 -08:00
1a4cd326e8 Merge #1781
1781: Cranelift upgrade r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

Upgrade Cranelift to `0.67`. This upgrade also enables all SIMD tests (with one small exception operator that is still not fixed in Cranelift).

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-10-30 04:47:24 +00:00
b123f92f56 Simplified local_decl 2020-10-29 20:19:37 -07:00
afbfcefb03 Implement new SIMD zero-extend loads. 2020-10-29 17:14:04 -07:00
68a0ae9615 Upgrade wasmparser to 0.63 2020-10-29 16:43:02 -07:00
ba60630407 Upgrade wasmparser to 0.62 2020-10-29 16:21:43 -07:00
b7792f03c2 Upgrade wasmparser to 0.60 2020-10-29 15:50:04 -07:00
e89b1c089b Split the ABIs into separate implementations and trait files. 2020-10-23 14:09:14 -07:00
e4981c4f66 Add a get_abi(TargetMachine) method instead of creating X86_64SystemV directly.
A new Arm64Linux ABI is added but it's an unedited copy of the X86_64SystemV one so far.

A bunch of cleanups from clippy. Use matches! more, don't pass &Box<dyn Abi>.
2020-10-20 14:46:45 -07:00
fa8e423404 Make abi a trait. 2020-10-20 12:53:09 -07:00
d562c2dd9c Sometimes the store may be partially-successful before trapping, for instance if it is partways in valid memory and partways into the guard page.
Use a load instruction before the store to ensure that all the memory is addressable. The loaded value is discarded.

NB. We don't apply this to atomics. It's not clear whether atomic stores can be half-committed.

Fixes align.wast and memory_trap.wast on aarch64.
2020-10-16 16:29:45 -07:00
1a10d2258e Merge branch 'master' into feature/dynamic 2020-08-21 10:43:09 -07:00
5d40787856 Add a compiler-llvm CompilerFunctionKind for the whole module which can occur with the experimental API for engine-native.
Since it's no longer per-function, rename CompilerFunctionKind to CompilerKind.
2020-08-20 23:28:07 -07:00
8a27a2938b Turn VMMemoryDefinition::current_length into a u32.
The current wasm spec limits the size to 32-bits, and attempting to use a larger size causes problems with compiler-cranelift.
2020-08-19 18:04:12 -07:00
5a6ecd4d00 Fix dynamic memory styles in llvm.
Dynamic memory has the same struct as static memory, in particular the length field is not a pointer to a length field.

Also, send the correct trap code.
2020-08-19 17:43:05 -07:00
91414df670 NFC. Import the inkwell::DLLStorageClass name. 2020-08-18 14:20:45 -07:00
36850d6230 Set the DLL storage class to export. 2020-08-17 23:23:39 -07:00
6e974b92cd Run cargo fmt 2020-08-13 18:12:43 -07:00
5049c543dc Rename wasm-common crate to wasmer-types 2020-08-13 17:59:26 -07:00