codegen: don't use inline asm on MSVC/ARM

This commit is contained in:
David Hrdlička
2020-12-17 12:06:31 +01:00
parent 251dc45048
commit 34422d27dd
2 changed files with 8 additions and 0 deletions

View File

@@ -327,9 +327,13 @@ printf("block_pos=%i\n", block_pos);
block_write_data = NULL;
//fatal("block_pos=%i\n", block_pos);
#if !defined _MSC_VER || defined __clang__
asm("vmrs %0, fpscr\n"
: "=r" (cpu_state.old_fp_control)
);
#else
cpu_state.old_fp_control = _controlfp();
#endif
if ((cpu_state.old_fp_control >> 22) & 3)
fatal("VFP not in nearest rounding mode\n");
}

View File

@@ -332,9 +332,13 @@ void codegen_backend_init()
codegen_allocator_clean_blocks(block->head_mem_block);
#if !defined _MSC_VER || defined __clang__
asm("mrs %0, fpcr\n"
: "=r" (cpu_state.old_fp_control)
);
#else
cpu_state.old_fp_control = _controlfp();
#endif
}
void codegen_set_rounding_mode(int mode)