Skip to content

Commit 332b4ce

Browse files
authored
fuzz: Enable winch-aarch64 (bytecodealliance#12646)
As of bytecodealliance#11051, Winch supports all of Core Wasm on aarch64. This commit enables fuzzing respectively.
1 parent c07c94d commit 332b4ce

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

crates/fuzzing/src/generators/config.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ impl WasmtimeConfig {
671671
// config features are enabled based on the compiler strategy, and we
672672
// don't want to make the same fuzz input DNA generate different test
673673
// cases on different targets.
674-
if cfg!(not(target_arch = "x86_64")) {
674+
if cfg!(not(any(target_arch = "x86_64", target_arch = "aarch64"))) {
675675
log::warn!(
676676
"want to compile with Winch but host architecture does not support it"
677677
);
@@ -700,6 +700,14 @@ impl WasmtimeConfig {
700700
config.config.simd_enabled = false;
701701
}
702702

703+
// Account for the proposals that are currently only
704+
// supported on x64.
705+
if cfg!(target_arch = "aarch64") {
706+
config.config.simd_enabled = false;
707+
config.config.wide_arithmetic_enabled = false;
708+
config.config.threads_enabled = false;
709+
}
710+
703711
// Tuning the following engine options is currently not supported
704712
// by Winch.
705713
self.signals_based_traps = true;

crates/fuzzing/src/oracles/diff_wasmtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ mod tests {
273273

274274
#[test]
275275
fn smoke_winch() {
276-
if !cfg!(target_arch = "x86_64") {
276+
if !cfg!(target_arch = "x86_64") || !cfg!(target_arch = "aarch64") {
277277
return;
278278
}
279279
crate::oracles::engine::smoke_test_engine(|u, config| {

crates/fuzzing/src/oracles/engine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ pub fn build(
2828
)?),
2929
"wasmi" => Box::new(WasmiEngine::new(config)),
3030

31-
#[cfg(target_arch = "x86_64")]
31+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
3232
"winch" => Box::new(WasmtimeEngine::new(u, config, CompilerStrategy::Winch)?),
33-
#[cfg(not(target_arch = "x86_64"))]
33+
#[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))]
3434
"winch" => return Ok(None),
3535

3636
#[cfg(feature = "fuzz-spec-interpreter")]

fuzz/fuzz_targets/differential.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl RuntimeStats {
271271
let total = v8 + spec + wasmi + wasmtime + winch + pulley;
272272
println!(
273273
"\twasmi: {:.02}%, spec: {:.02}%, wasmtime: {:.02}%, v8: {:.02}%, \
274-
winch: {:.02}, \
274+
winch: {:.02}%, \
275275
pulley: {:.02}%",
276276
wasmi as f64 / total as f64 * 100f64,
277277
spec as f64 / total as f64 * 100f64,

0 commit comments

Comments
 (0)