From b38a3d1369c9772fc2a192ceebf76af566011521 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 10 Mar 2021 23:32:06 -0500 Subject: [PATCH] [wasm] Turn off canonization of NaNs. It doesn't seem to be needed, and it causes test failures. Fixes https://github.com/dotnet/runtime/issues/49245. --- src/mono/mono/mini/mini-llvm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 7dcc4b71a810db..4dc8d3534c6523 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -4877,11 +4877,12 @@ emit_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef builder bblocks [bb->block_num].bblock = target_bb; } -//Wasm requires us to canonicalize NaNs. static LLVMValueRef get_double_const (MonoCompile *cfg, double val) { -#ifdef TARGET_WASM + //#ifdef TARGET_WASM +#if 0 + //Wasm requires us to canonicalize NaNs. if (mono_isnan (val)) *(gint64 *)&val = 0x7FF8000000000000ll; #endif @@ -4891,7 +4892,8 @@ get_double_const (MonoCompile *cfg, double val) static LLVMValueRef get_float_const (MonoCompile *cfg, float val) { -#ifdef TARGET_WASM + //#ifdef TARGET_WASM +#if 0 if (mono_isnan (val)) *(int *)&val = 0x7FC00000; #endif