From 34422d27dd7dcacf4af9c4668f5b607a806b627e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Thu, 17 Dec 2020 12:06:31 +0100 Subject: [PATCH] codegen: don't use inline asm on MSVC/ARM --- src/codegen_new/codegen_backend_arm.c | 4 ++++ src/codegen_new/codegen_backend_arm64.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/codegen_new/codegen_backend_arm.c b/src/codegen_new/codegen_backend_arm.c index f423f72d8..794a16525 100644 --- a/src/codegen_new/codegen_backend_arm.c +++ b/src/codegen_new/codegen_backend_arm.c @@ -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"); } diff --git a/src/codegen_new/codegen_backend_arm64.c b/src/codegen_new/codegen_backend_arm64.c index 6571a0ad3..fab1a310d 100644 --- a/src/codegen_new/codegen_backend_arm64.c +++ b/src/codegen_new/codegen_backend_arm64.c @@ -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)