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

winch: Add support for WebAssembly loads/stores #7894

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
25 changes: 22 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ fn write_testsuite_tests(
fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
assert!(strategy == "Cranelift" || strategy == "Winch");

// Ignore everything except the winch misc test suite.
// Ignore some tests for when testing Winch.
if strategy == "Winch" {
if testsuite == "misc_testsuite" {
// The misc/call_indirect is fully supported by Winch.
Expand All @@ -212,8 +212,27 @@ fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
}
}
if testsuite == "spec_testsuite" {
// The official following tests are supported.
return !["table_init", "table_copy"].contains(&testname);
let denylist = [
"br_table",
"conversions",
"global",
"table_fill",
"table_get",
"table_set",
"table_grow",
"table_size",
"elem",
"select",
"unreached_invalid",
"imports",
"linking",
]
.contains(&testname);

let ref_types = testname.starts_with("ref_");
let simd = testname.starts_with("simd_");

return denylist || ref_types || simd;
}

if testsuite != "winch" {
Expand Down
3 changes: 2 additions & 1 deletion cranelift/codegen/src/isa/x64/inst/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ impl Amode {
Self::RipRelative { target }
}

pub(crate) fn with_flags(&self, flags: MemFlags) -> Self {
/// Set the specified [MemFlags] to the [Amode].
pub fn with_flags(&self, flags: MemFlags) -> Self {
match self {
&Self::ImmReg { simm32, base, .. } => Self::ImmReg {
simm32,
Expand Down
25 changes: 24 additions & 1 deletion fuzz/fuzz_targets/differential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,30 @@ fn winch_supports_module(module: &[u8]) -> bool {
| MemoryFill { .. }
| MemoryInit { .. }
| DataDrop { .. }
| MemorySize { .. } => {}
| MemorySize { .. }
| I32Load { .. }
| I32Load8S { .. }
| I32Load8U { .. }
| I32Load16S { .. }
| I32Load16U { .. }
| I64Load8S { .. }
| I64Load8U { .. }
| I64Load16S { .. }
| I64Load16U { .. }
| I64Load32S { .. }
| I64Load32U { .. }
| I64Load { .. }
| I32Store { .. }
| I32Store8 { .. }
| I32Store16 { .. }
| I64Store { .. }
| I64Store8 { .. }
| I64Store16 { .. }
| I64Store32 { .. }
| F32Load { .. }
| F32Store { .. }
| F64Load { .. }
| F64Store { .. } => {}
saulecabrera marked this conversation as resolved.
Show resolved Hide resolved
_ => {
supported = false;
break 'main;
Expand Down
287 changes: 0 additions & 287 deletions tests/misc_testsuite/winch/block.wast

This file was deleted.

Loading
Loading