diff --git a/src/coreclr/jit/codegenwasm.cpp b/src/coreclr/jit/codegenwasm.cpp index 32f5ef4cdb950b..45dce609c4e6ef 100644 --- a/src/coreclr/jit/codegenwasm.cpp +++ b/src/coreclr/jit/codegenwasm.cpp @@ -650,6 +650,11 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) default: #ifdef DEBUG + if (JitConfig.JitWasmNyiToR2RUnsupported()) + { + NYI_WASM("Opcode not implemented"); + } + NYIRAW(GenTree::OpName(treeNode->OperGet())); #else NYI_WASM("Opcode not implemented"); diff --git a/src/coreclr/jit/error.h b/src/coreclr/jit/error.h index 5692730cd4b6b0..cf2103620f2c9f 100644 --- a/src/coreclr/jit/error.h +++ b/src/coreclr/jit/error.h @@ -225,7 +225,14 @@ extern void notYetImplemented(const char* msg, const char* file, unsigned line); #define NYI_ARM64(msg) do { } while (0) #define NYI_LOONGARCH64(msg) do { } while (0) #define NYI_RISCV64(msg) do { } while (0) + +#if DEBUG +#define NYI_WASM(msg) do { if (JitConfig.JitWasmNyiToR2RUnsupported() > 0) \ + { JITDUMP("NYI_WASM: " msg); implReadyToRunUnsupported(); } \ + else { NYIRAW("NYI_WASM: " msg); } } while (0) +#else #define NYI_WASM(msg) NYIRAW("NYI_WASM: " msg) +#endif // DEBUG #else diff --git a/src/coreclr/jit/jitconfigvalues.h b/src/coreclr/jit/jitconfigvalues.h index 7741e0f6b8fe19..2c2e9a350aa80f 100644 --- a/src/coreclr/jit/jitconfigvalues.h +++ b/src/coreclr/jit/jitconfigvalues.h @@ -864,6 +864,11 @@ CONFIG_INTEGER(JitUseScalableVectorT, "JitUseScalableVectorT", 0) CONFIG_INTEGER(JitDispIns, "JitDispIns", 0) #endif // defined(TARGET_LOONGARCH64) +#if defined(TARGET_WASM) +// Set this to 1 to turn NYI_WASM into R2R unsupported failures instead of asserts. +CONFIG_INTEGER(JitWasmNyiToR2RUnsupported, "JitWasmNyiToR2RUnsupported", 0) +#endif // defined(TARGET_WASM) + // Allow to enregister locals with struct type. RELEASE_CONFIG_INTEGER(JitEnregStructLocals, "JitEnregStructLocals", 1)