Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaN canonicalization for singlepass backend. #1303

Merged
merged 23 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8ea7bfd
NaN canonicalization by tracking values.
losfair Mar 15, 2020
5d26d92
Add switch to turn on/off NaN canonicalization.
losfair Mar 16, 2020
da07ed5
Add clif/llvm NaN spectest failure excludes.
losfair Mar 16, 2020
ae9b321
Update changelog.
losfair Mar 16, 2020
29b5223
Canonicalize NANs produced by f.trunc and f.nearby.
nlewycky Mar 16, 2020
8f2bb84
Merge pull request #1308 from wasmerio/nlewycky/llvm-nan-cncl
syrusakbary Mar 16, 2020
3ee7f43
Enable nan canonicalization for cranelift backend.
losfair Mar 17, 2020
4357c15
Fix missing canonicalizations.
losfair Mar 17, 2020
e0538d3
Remove clif spectest excludes.
losfair Mar 17, 2020
1ddf3a1
Add mem/local NaN tests.
losfair Mar 17, 2020
1d9f0c5
Style fixes and fix missing canonicalization at function call.
losfair Mar 17, 2020
72bc9f6
Add call canonicalization tests.
losfair Mar 17, 2020
5e40be4
Merge remote-tracking branch 'origin/master' into feature/singlepass-…
losfair Mar 17, 2020
8e92e32
Disable canonicalization for aarch64.
losfair Mar 17, 2020
bfc3b82
Apply suggestions from code review
losfair Mar 17, 2020
86dde8c
Add missing movs.
losfair Mar 17, 2020
3a18b70
Merge remote-tracking branch 'origin/feature/singlepass-nan-cncl' int…
losfair Mar 17, 2020
ea0cd72
Cargo fmt
losfair Mar 17, 2020
a9cd6d6
Add aarch64 NaN canonicalization spectest excludes.
losfair Mar 17, 2020
29a431c
Remove 4 spectest excludes that are no longer needed.
losfair Mar 17, 2020
8485ccc
Update comment for `nan_canonicalization`.
losfair Mar 17, 2020
c25ba62
Add comment for call argument list preprocessing.
losfair Mar 18, 2020
d1e8674
Merge branch 'master' into feature/singlepass-nan-cncl
losfair Mar 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## **[Unreleased]**

- [#1303](https://github.com/wasmerio/wasmer/pull/1303) NaN canonicalization for singlepass backend.
- [#1301](https://github.com/wasmerio/wasmer/pull/1301) Update supported stable Rust version to 1.41.1.
- [#1285](https://github.com/wasmerio/wasmer/pull/1285) Greatly improve errors in `wasmer-interface-types`
- [#1283](https://github.com/wasmerio/wasmer/pull/1283) Workaround for floating point arguments and return values in `DynamicFunc`s.
Expand Down
8 changes: 4 additions & 4 deletions lib/llvm-backend/src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3701,7 +3701,7 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
.try_as_basic_value()
.left()
.unwrap();
state.push1_extra(res, i);
state.push1_extra(res, i | ExtraInfo::pending_f32_nan());
}
Operator::F64Trunc => {
let (v, i) = state.pop1_extra()?;
Expand All @@ -3714,7 +3714,7 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
.try_as_basic_value()
.left()
.unwrap();
state.push1_extra(res, i);
state.push1_extra(res, i | ExtraInfo::pending_f64_nan());
}
Operator::F32Nearest => {
let (v, i) = state.pop1_extra()?;
Expand All @@ -3727,7 +3727,7 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
.try_as_basic_value()
.left()
.unwrap();
state.push1_extra(res, i);
state.push1_extra(res, i | ExtraInfo::pending_f32_nan());
}
Operator::F64Nearest => {
let (v, i) = state.pop1_extra()?;
Expand All @@ -3740,7 +3740,7 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
.try_as_basic_value()
.left()
.unwrap();
state.push1_extra(res, i);
state.push1_extra(res, i | ExtraInfo::pending_f64_nan());
}
Operator::F32Abs => {
let (v, i) = state.pop1_extra()?;
Expand Down
4 changes: 4 additions & 0 deletions lib/runtime-core/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ pub struct CompilerConfig {
/// When enabled there can be a small amount of runtime performance overhead.
pub full_preemption: bool,

/// Whether to enable spec-compliant NaN canonicalization at all places.
losfair marked this conversation as resolved.
Show resolved Hide resolved
/// Enabling this increases runtime overhead.
pub nan_canonicalization: bool,

pub features: Features,

// Target info. Presently only supported by LLVM.
Expand Down
Loading