From 0d97e3b4a3fa0cfb539e335307b73d57c713835e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 5 Oct 2025 08:11:18 -0700 Subject: [PATCH] x64: Fix `has_native_fma` This commit synchronizes the implementation of lowering and `has_native_fma` where lowering requires both AVX + FMA but `has_native_fma` was just testing FMA, meaning that if `has_fma` was enabled but `has_avx` was disabled it would be possible to generate a link-time error with Wasmtime. --- cranelift/codegen/src/isa/x64/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cranelift/codegen/src/isa/x64/mod.rs b/cranelift/codegen/src/isa/x64/mod.rs index 2bdb367d7736..f40fef58c096 100644 --- a/cranelift/codegen/src/isa/x64/mod.rs +++ b/cranelift/codegen/src/isa/x64/mod.rs @@ -177,7 +177,7 @@ impl TargetIsa for X64Backend { } fn has_native_fma(&self) -> bool { - self.x64_flags.has_fma() + self.x64_flags.has_avx() && self.x64_flags.has_fma() } fn has_round(&self) -> bool {