From f77fad0fa4b41155e8040550da4725234adc1b2a Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Wed, 9 Sep 2026 20:23:29 +0100 Subject: [PATCH] fix: selectively re-enable SIMD for ppc64 (#5776) Fixes for WASM SIMD on Power >= 9 went into Node.js 25.0.0 and 24.12.0. Re-enable SIMD by default for ppc64, and only disable for the older unpatched versions of Node.js. Signed-off-by: Richard Lau (cherry picked from commit 8d985d22db7e406599323af08acd15046d5e3a5e) --- lib/dispatcher/client-h1.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/dispatcher/client-h1.js b/lib/dispatcher/client-h1.js index ed119b7156b..02c9ceeb4bc 100644 --- a/lib/dispatcher/client-h1.js +++ b/lib/dispatcher/client-h1.js @@ -69,8 +69,14 @@ function lazyllhttp () { let mod - // We disable wasm SIMD on ppc64 as it seems to be broken on Power 9 architectures. - let useWasmSIMD = process.arch !== 'ppc64' + // We disable wasm SIMD on older versions of Node.js on ppc64 that are broken on Power >=9 architectures. + let useWasmSIMD = true + if (process.arch === 'ppc64') { + const [major, minor] = process.versions.node.split('.').map(n => parseInt(n, 10)) + if (major < 24 || (major === 24 && minor < 12)) { + useWasmSIMD = false + } + } // The Env Variable UNDICI_NO_WASM_SIMD allows explicitly overriding the default behavior if (process.env.UNDICI_NO_WASM_SIMD === '1') { useWasmSIMD = false