From 9308afa7cf640ab4877df23ebb6fd756d7216716 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Wed, 24 Jun 2026 11:43:15 -0700 Subject: [PATCH] JIT/wasm: bail R2R for calls passing 16-byte SIMD by value Passing a Vector128 (v128) argument by value through a call is not yet correctly implemented on wasm: the argument is materialized as an i32 (by-ref) while the call signature requires v128, producing an invalid module. Mark such methods R2R-unsupported via NYI_WASM_SIMD until the SIMD call ABI is implemented. Lets System.Private.CoreLib.wasm validate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/jit/codegenwasm.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/coreclr/jit/codegenwasm.cpp b/src/coreclr/jit/codegenwasm.cpp index 7a0bbb5efeb440..06da75db3e2be4 100644 --- a/src/coreclr/jit/codegenwasm.cpp +++ b/src/coreclr/jit/codegenwasm.cpp @@ -2790,6 +2790,13 @@ void CodeGen::genCallInstruction(GenTreeCall* call) assert(seg.IsPassedInRegister()); WasmValueType wvt = WasmRegToType(seg.GetRegister()); assert(wvt < WasmValueType::Count); + if (wvt == WasmValueType::V128) + { + // Passing a 16-byte SIMD value by value through a call is not yet correctly + // implemented: the argument is materialized as an i32 (by-ref) while the call + // signature requires v128, producing an invalid module. Bail for now. + NYI_WASM_SIMD("SIMD16 call argument"); + } typeStack.Push((CorInfoWasmType)emitter::GetWasmValueTypeCode(wvt)); } }