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

make canonicalize-nan.wast test work #9878

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

Lordworms
Copy link
Contributor

@Lordworms Lordworms commented Dec 20, 2024

part of #9783

@Lordworms Lordworms requested review from a team as code owners December 20, 2024 05:22
@Lordworms Lordworms requested review from cfallin and fitzgen and removed request for a team December 20, 2024 05:22
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator pulley Issues related to the Pulley interpreter labels Dec 20, 2024
Copy link

Subscribe to Label Action

cc @fitzgen

This issue or pull request has been labeled: "cranelift", "pulley"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: pulley

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

0x7fc00000
} else {
val.to_bits()
};
Copy link
Member

Choose a reason for hiding this comment

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

I'm surprised this is necessary: the intent of canonicalize-nan.wast is to test Cranelift's NaN-canonicalization pass, and this pass operates on the machine-independent IR (CLIF) so it should work for compilation to Pulley as well as any other target. The Pulley virtual machine shouldn't have to unconditionally canonicalize NaNs.

Could you check whether the pass is producing NaN-canonicalization sequences (which look like compares to test for NaN, then a select operator)?

I'm wondering whether this might have something to do with the has_vector_support boolean in Context::canonicalize_nans(); the comment there (that riscv64 is the only architecture without vector support) is no longer accurate now that we have Pulley in-tree; I'm not sure but perhaps that's related?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I think this might be my fault, in the contribution docs for pulley it recommends running the test suite directly via wasmtime wast .../*.wast. When tests/misc_testsuite/simd/canonicalize-nan.wast is executed that's actually expected to fail (it even fails on native) and it requires an extra -W nan-canonicalization flag.

Chris is right though in that the manual canonicalization here shouldn't be necessary. @Lordworms you'll find though that -W nan-canonicalization isn't fully supported just yet:

Error: failed to run script file './tests/misc_testsuite/simd/canonicalize-nan.wast'

Caused by:
    0: failed directive on ./tests/misc_testsuite/simd/canonicalize-nan.wast:7:1
    1: Compilation error: Unsupported feature: should be implemented in ISLE: inst = `v10 = fcmp.f32x4 uno v7, v7`, type = `Some(types::I32X4)`

That being said this PR still gets the simd_f32x4_rounding.wast test passing, so with the canonicalization removed it should still be good to flag that test as passing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am new to this project and didn't find it. Sorry for that.

pulley/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines 512 to 513
"spec_testsuite/simd_f32x4_rounding.wast",
"spec_testsuite/simd_f64x2.wast",
"spec_testsuite/simd_f64x2_arith.wast",
"spec_testsuite/simd_f64x2_cmp.wast",
"spec_testsuite/simd_f64x2_pmin_pmax.wast",
"spec_testsuite/simd_f64x2_rounding.wast",
Copy link
Member

Choose a reason for hiding this comment

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

Oh this'll want to stay as these are test exemptions for a different compiler, Winch, unrelated to Pulley. Only the ones above are the ones affecting Pulley.

Also it looks like a merge conflict has creeped in due to this file, so if you want to rebase that should help resolve the conflict.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved it.

@@ -419,11 +419,10 @@ impl WastTest {
"spec_testsuite/simd_f32x4_arith.wast",
"spec_testsuite/simd_f32x4_cmp.wast",
"spec_testsuite/simd_f32x4_pmin_pmax.wast",
"spec_testsuite/simd_f32x4_rounding.wast",
"spec_testsuite/simd_f64x2.wast",
Copy link
Member

Choose a reason for hiding this comment

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

Oh I think this test popped back in by accident during the rebase

@alexcrichton alexcrichton added this pull request to the merge queue Dec 20, 2024
Merged via the queue into bytecodealliance:main with commit 058d751 Dec 20, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator pulley Issues related to the Pulley interpreter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants