Commit Graph

4045 Commits

Author SHA1 Message Date
Ivan Enderlin
e559b54309 fix(singlepass-backend) Use wasmparser from runtime-core.
The `wasmer-runtime-core` crate re-exports the `wasmparser`
crate. This patch updates the `singlepass-backend` crate to use
`wasmparser` through the `wasmer-runtime-core` crate, which removes a
direct dependency for this crate.
2019-10-18 11:22:40 +02:00
bors[bot]
33f6c0278d
Merge #867
867: Initial implementation of `assert_uninstantiable`. r=nlewycky a=nlewycky

# Description
Add a basic implementation of `assert_uninstantiable` in the spectest runner. Fixes one line of spectests in all three backends.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-18 02:24:14 +00:00
Nick Lewycky
fbe2701a93 I meant 'skip' not 'fail'. 2019-10-17 19:23:36 -07:00
Nick Lewycky
675399909a Skip this test on windows + cranelift. It crashes the whole spectest runner.
This exclusion is no worse than before where this test was silently ignored.
2019-10-17 18:38:11 -07:00
Nick Lewycky
87d272e31e Initial implementation of AssertUninstantiable. Fixes linking.wast:387. 2019-10-17 18:37:49 -07:00
Nick Lewycky
b180a2e14c Get aggressive about running cargo check over all packages with all features.
Fixes the one issue uncovered. The capstone disassembling support in the LLVM backend was broken. Fixed by removing it. Instead, use the `--llvm-object-file` flag to get a finished object file to disassemble with any disassembler.
2019-10-17 15:37:35 -07:00
Ivan Enderlin
a257995f8d fix(win-exception-handler) Remove bindgen and regex from cargo build deps.
Those crates are not used.
2019-10-17 23:53:53 +02:00
bors[bot]
5ca6fc4aaa
Merge #885
885: fix(cranelift-backend) Remove broken (and useless?) debug code r=nlewycky a=Hywan

This debug code is broken (it doesn't compile). It can be assumed
nobody uses it, and can be considered as dead code. As such, this PR
removes it.

The `debug` feature is kept in `Cargo.toml` to activate `wasmer-runtime-core/debug`.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-10-17 21:25:46 +00:00
Ivan Enderlin
f101775380 fix(cranelift-backend) Remove broken (and useless?) debug code.
This debug code is broken (it doesn't compile). It can be assumed
nobody uses it, and can be considered as dead code. As such, this PR
removes it.
2019-10-17 22:55:30 +02:00
bors[bot]
62b2cdc5e9
Merge #884
884: Show the full hex value of a float that fails assert returns arithmetic nan or assert returns canonical nan. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-17 19:29:22 +00:00
nlewycky
eaf16f61bf
Merge branch 'master' into feature/llvm-nan-but-fast 2019-10-17 12:24:56 -07:00
Nick Lewycky
c0acd5be11 Show the full hex value of a float that fails assert returns arithmetic nan or assert returns canonical nan. 2019-10-17 12:20:34 -07:00
Nick Lewycky
2c5c1b1c2c For floating point operations, allow inputs to be arbitrary, including SNaNs.
Instead of ensuring outputs are arithmetic NaNs on every function, we tag them as pending such a check, so that a sequence of computation can have a single canonicalization step at the end.

There's an extra wriggle for SIMD. The Wasm type system only indicates them as V128, so it's possible that we might do computations as F32x4Add, I8x16Add, F64x2Add in a row with no other computations in between. Thus, most SIMD functions apply pending canonicalizations to their inputs, even integer SIMD operations.
2019-10-17 11:55:01 -07:00
losfair
cd0b49e661 popcnt for aarch64. 2019-10-18 00:18:15 +08:00
losfair
a057296618 (S32, Imm64, GPR) 2019-10-17 23:45:58 +08:00
losfair
3f35a74b84 Two more mov variants. 2019-10-17 23:40:44 +08:00
losfair
4df7973639 Add mov variants. 2019-10-17 23:34:24 +08:00
losfair
00242cdd7f Fix LEA simulation on aarch64. 2019-10-17 23:00:50 +08:00
losfair
d325635629 Increment aarch64 virtual stack size to 1MB. 2019-10-17 23:00:32 +08:00
bors[bot]
8c308d055b
Merge #880
880: Remove usage of LZCNT and TZCNT from singlepass. r=nlewycky a=nlewycky

# Description
This PR removes usage of LZCNT and TZCNT in singlepass to work on machines that don't support them. Unlike other instructions that fail loudly when not supported, LZCNT and TZCNT silently change behaviour by falling back to BSR and BSF which may produce different answers. They were used in the I32Clz, I32Ctz, I64Clz and I64Ctz instructions. Fixes i32.wast and i64.wast test failures on our Mac buildbot.

As an alternative, we could detect presence of LZCNT and TZCNT at runtime, either by running them directly or by querying CPUID to detect whether the CPU claims support for these instructions. I decided against that because having multiple paths is more complicated, and we aren't concerned with runtime of singlepass code, as a rule.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-10-17 00:13:02 +00:00
nlewycky
01e81ee809
Merge branch 'master' into feature/singlepass-mac-int 2019-10-16 17:12:36 -07:00
Syrus Akbary
eafb1237a8
Merge pull request #881 from Hywan/feat-runtime-core-imported-closure
feat(runtime-core) Add documentation and make macros more readable.
2019-10-16 16:20:29 -07:00
Nick Lewycky
f99d0360d2 Add registers XMM8--15 to from_dwarf_regnum and invoke_call_return_on_stack. 2019-10-16 10:34:37 -07:00
Ivan Enderlin
81be25d970 feat(runtime-core) Add documentation and make macros more readable.
After a long time, the macros are easy to read, but not at first
glance. I hope this PR will improve the situation: Same syntax used
everywhere, more spaces…
2019-10-16 16:07:50 +02:00
Nick Lewycky
5ee311adab These were both calling i32.clz. They should be fixed. 2019-10-15 14:10:26 -07:00
Nick Lewycky
4e5d559ab5 Remove dead functions LZCNT and TZCNT. 2019-10-15 13:44:18 -07:00
Nick Lewycky
99f7499a05 Reimplement I32Ctz, I64Clz and I64Ctz without LZCNT or TZCNT. 2019-10-15 13:42:05 -07:00
Nick Lewycky
3e854c4a3b Remove the exclusions for I32Clz. 2019-10-15 13:21:07 -07:00
Nick Lewycky
cafcfd3b50 cargo fmt 2019-10-15 13:07:44 -07:00
Nick Lewycky
cf3d2a830d Reimplement I32Clz without relying on LZCNT. 2019-10-15 12:50:59 -07:00
bors[bot]
caae21c065
Merge #879
879: Add extended system information for Mac. Enough to see CPUID flags. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-15 19:08:28 +00:00
Nick Lewycky
761a5e843c Indentation for syntax. 2019-10-15 11:08:10 -07:00
Nick Lewycky
169665db8c Add extended system information for Mac. Enough to see CPUID flags. 2019-10-15 11:03:55 -07:00
losfair
3de0c7763f Skip inline non-instruction data. 2019-10-15 22:12:08 +08:00
losfair
81d538ade2 Fix disp < 0 case. 2019-10-15 22:00:33 +08:00
losfair
ee88c459e5 Allow arbitrary size of disp. 2019-10-15 21:55:04 +08:00
Nick Lewycky
feeb9cd8f9 These tests failed on mac on bors. Put them back. 2019-10-14 15:02:51 -07:00
Nick Lewycky
26a4f073f0 Implement F64Min and F64Max. 2019-10-14 14:15:18 -07:00
Nick Lewycky
06ffb00deb Reimplement F32Max. 2019-10-14 14:07:30 -07:00
Nick Lewycky
b886a41a85 Use temp_gprs instead of hard-coding RAX/RDX. 2019-10-14 13:53:30 -07:00
Nick Lewycky
5cee23455d Release the registers we acquire. Reformat. 2019-10-14 13:51:03 -07:00
Nick Lewycky
336dab7fd9 Don't use utility functions in F32Min implementation. 2019-10-14 13:46:55 -07:00
Nick Lewycky
765e1d3b9e Add XMM8--XMM15. These were added in x64. 2019-10-14 13:46:55 -07:00
Nick Lewycky
4b89e01806 Remove commented-out code that I added so as to not lose its history in git. Apply trivial cleanups and reformat.
Remove expected test failure entries that are fixed so far.
2019-10-14 13:46:55 -07:00
Nick Lewycky
963148fdce Fix F32Min for all cases including NaNs. 2019-10-14 13:46:55 -07:00
Nick Lewycky
8b937afc1f Add comments to indicate the implemention we'd like to have, but can't right now. 2019-10-14 13:46:55 -07:00
Nick Lewycky
0f712c90ab Don't allocate another register when it's safe to reuse dst. 2019-10-14 13:46:55 -07:00
Nick Lewycky
b75e5c0c7c When we know RDX is unavailable, use RAX instead. Should be fine here. 2019-10-14 13:46:55 -07:00
Nick Lewycky
d6eba03a2f Remove loc1/loc2. That intended refactoring didn't work out. 2019-10-14 13:46:55 -07:00
Nick Lewycky
555d933057 Initial commit, reimplementation of F32Min. Fixes F32Min(negative_zero, zero) issue.
Also removes some previously-fixed i32 and i64 exclusions from the tests.
2019-10-14 13:46:55 -07:00