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.
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>
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…
876: Bump structopt from 0.3.2 to 0.3.3 r=Hywan a=dependabot-preview[bot]
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.2 to 0.3.3.
<details>
<summary>Changelog</summary>
*Sourced from [structopt's changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md).*
> # v0.3.3 (2019-10-10)
>
> * Add `from_flag` custom parser to create flags from non-bool types.
> Fixes [#185](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/185)
</details>
<details>
<summary>Commits</summary>
- [`2cb1fbf`](2cb1fbf679) v0.3.3
- [`fd2cc62`](fd2cc62b63) Add from_flag parser ([#271](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/271))
- [`6a3fc8b`](6a3fc8bc79) Run ui tests only on stable
- [`8d86616`](8d86616957) Fix code formatting
- [`cf61ff1`](cf61ff1eaf) Fix nightly tests
- [`0c888e9`](0c888e962d) Fix clippy warnings
- [`1cae9fa`](1cae9fab4b) Suppress all clippy warnings
- [`c228c23`](c228c2399b) Fix version in docs (AGAIN)
- See full diff in [compare view](https://github.com/TeXitoi/structopt/compare/v0.3.2...v0.3.3)
</details>
<br />
[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=structopt&package-manager=cargo&previous-version=0.3.2&new-version=0.3.3)](https://dependabot.com/compatibility-score.html?dependency-name=structopt&package-manager=cargo&previous-version=0.3.2&new-version=0.3.3)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
</details>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
863: Rewrite Min/Max to handle all cases correctly. Fixes 545 spectest failures. r=nlewycky a=nlewycky
# Description
The llvm backend was not quite following the Wasm spec for {F32,F64,F32x4xF64x2}{Min,Max}. We used the `@llvm.minnum` and `@llvm.maxnum` intrinsics which don't handle the corner cases the same. When we tried to use `@llvm.minimum` and `@llvm.maximum` which do, we get an internal error from the x86 backend. I was hoping that crash would go away with the upgrade to LLVM 9, but it does not.
Reimplement these operations using plain LLVM instructions.
# Review
- [x] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Nick Lewycky <nick@wasmer.io>
870: Fix unused value warning due to inkwell API change. NFC. r=nlewycky a=nlewycky
# Description
Fix unused value warning due to inkwell API change. No functionality change.
Co-authored-by: Nick Lewycky <nick@wasmer.io>
872: Pass llvm debug flags to the llvm backend. r=nlewycky a=nlewycky
This was accidentally removed in 124ad73e8a .
Co-authored-by: Nick Lewycky <nick@wasmer.io>
869: Remove exclusions for tests that appear to be passing right now. r=nlewycky a=nlewycky
# Description
Remove exclusions for tests that appear to be passing right now.
Co-authored-by: Nick Lewycky <nick@wasmer.io>
868: Replace "be the i32 type" with "be an i32" in error messages. r=nlewycky a=nlewycky
# Description
Adjust wording in error messages.
Co-authored-by: Nick Lewycky <nick@wasmer.io>