[arm64] use opcode emulation for fconv/rconv
authorBernhard Urban <lewurm@gmail.com>
Mon, 26 Aug 2019 20:00:06 +0000 (16:00 -0400)
committerLarry Ewing <lewing@microsoft.com>
Wed, 28 Aug 2019 01:35:42 +0000 (20:35 -0500)
LLVM eagerly optimizes constants such as NaN in a way that does not align with .NET behaviour. In the future we can change it so that we only do opcode emulation when LLVM is used.

Fixes https://github.com/mono/mono/issues/16411

Commit migrated from https://github.com/mono/mono/commit/475defca4d4d24dc44c660244b645df5f33e20ac

src/mono/mono/mini/mini-arm64.h

index e0c4014..381160e 100644 (file)
@@ -110,13 +110,14 @@ typedef struct {
        int thunks_size;
 } MonoCompileArch;
 
+#define MONO_ARCH_EMULATE_FCONV_TO_U4 1
+#define MONO_ARCH_EMULATE_FCONV_TO_U8 1
 #ifdef MONO_ARCH_ILP32
 /* For the watch (starting with series 4), a new ABI is introduced: arm64_32.
  * We can still use the older AOT compiler to produce bitcode, because it's
  * "offset compatible". However, since it is targeting arm7k, it makes certain
  * assumptions that we need to align here. */
 #define MONO_ARCH_EMULATE_FCONV_TO_I8 1
-#define MONO_ARCH_EMULATE_FCONV_TO_U8 1
 #define MONO_ARCH_EMULATE_LCONV_TO_R8 1
 #define MONO_ARCH_EMULATE_LCONV_TO_R4 1
 #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1