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

Conversation

losfair
Copy link
Contributor

@losfair losfair commented Mar 15, 2020

  • Implementation
  • Test

@losfair losfair marked this pull request as ready for review March 16, 2020 15:45
Copy link
Contributor

@nlewycky nlewycky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about the value_stack and fp_stack getting out of sync. At the top of codegen_x64.rs feed_event():

debug_assert!(self.fp_stack.len() == self.value_stack.iter().filter(is_float).len());

?

lib/runtime-core/src/backend.rs Outdated Show resolved Hide resolved
lib/singlepass-backend/src/codegen_x64.rs Outdated Show resolved Hide resolved
lib/singlepass-backend/src/codegen_x64.rs Outdated Show resolved Hide resolved
lib/spectests/spectests/wasmer.wast Outdated Show resolved Hide resolved
lib/singlepass-backend/src/codegen_x64.rs Outdated Show resolved Hide resolved
lib/singlepass-backend/src/codegen_x64.rs Show resolved Hide resolved
lib/singlepass-backend/src/codegen_x64.rs Outdated Show resolved Hide resolved
lib/singlepass-backend/src/codegen_x64.rs Outdated Show resolved Hide resolved
lib/singlepass-backend/src/codegen_x64.rs Show resolved Hide resolved
Location::GPR(GPR::RAX),
);
match frame.returns[0] {
WpType::F32 | WpType::F64 => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is correct because you can apply canonicalization early, but I think this is unnecessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reference here is outdated so I'm not sure which part you are referring to; but if you mean the Phi-like branch like Br-ing out, early canonicalization is necessary because we don't have the static tracking information after.

@losfair
Copy link
Contributor Author

losfair commented Mar 17, 2020

bors try

bors bot added a commit that referenced this pull request Mar 17, 2020
@bors
Copy link
Contributor

bors bot commented Mar 17, 2020

try

Build failed

@losfair
Copy link
Contributor Author

losfair commented Mar 17, 2020

bors try

bors bot added a commit that referenced this pull request Mar 17, 2020
@bors
Copy link
Contributor

bors bot commented Mar 17, 2020

try

Build failed

@losfair
Copy link
Contributor Author

losfair commented Mar 18, 2020

bors try

bors bot added a commit that referenced this pull request Mar 18, 2020
@bors
Copy link
Contributor

bors bot commented Mar 18, 2020

try

Build succeeded

@losfair
Copy link
Contributor Author

losfair commented Mar 19, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 19, 2020

Build succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants