1
0
mirror of https://git.code.sf.net/p/mingw-w64/mingw-w64 synced 2025-04-18 17:44:18 +03:00

crt: Move ARM64 trunc implementation to C files.

In preparation for using naked functions.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
This commit is contained in:
Jacek Caban 2025-04-01 21:16:04 +02:00
parent d0c80252d6
commit 0b27cfc5ce
5 changed files with 27 additions and 27 deletions

View File

@ -705,8 +705,8 @@ src_msvcrtarm64=\
math/arm64/nearbyint.S \
math/arm64/nearbyintf.S \
math/arm64/nearbyintl.S \
math/arm64/trunc.S \
math/arm64/truncf.S \
math/arm64/trunc.c \
math/arm64/truncf.c \
misc/__p___argc.c \
misc/__p___argv.c \
misc/__p___wargv.c \

View File

@ -287,6 +287,14 @@ static inline unsigned int __mingw_statusfp(void)
return flags;
}
#define __ASM_NAKED_FUNC(name,code) \
asm(".text\n\t" \
".p2align 2\n\t" \
".globl " __MINGW64_STRINGIFY(__MINGW_USYMBOL(name)) "\n\t" \
".def " __MINGW64_STRINGIFY(__MINGW_USYMBOL(name)) "; .scl 2; .type 32; .endef\n\t" \
__MINGW64_STRINGIFY(__MINGW_USYMBOL(name)) ":\n\t" \
code "\n\t");
#ifdef __cplusplus
}
#endif

View File

@ -3,14 +3,10 @@
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#include <_mingw_mac.h>
.file "trunc.S"
.text
.p2align 2
.globl __MINGW_USYMBOL(trunc)
.def __MINGW_USYMBOL(trunc); .scl 2; .type 32; .endef
#include <math.h>
#include <internal.h>
__MINGW_USYMBOL(trunc):
frintz d0, d0
ret
__ASM_NAKED_FUNC(trunc,
"frintz d0, d0\n\t"
"ret")

View File

@ -1,16 +0,0 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#include <_mingw_mac.h>
.file "truncf.S"
.text
.p2align 2
.globl __MINGW_USYMBOL(truncf)
.def __MINGW_USYMBOL(truncf); .scl 2; .type 32; .endef
__MINGW_USYMBOL(truncf):
frintz s0, s0
ret

View File

@ -0,0 +1,12 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#include <math.h>
#include <internal.h>
__ASM_NAKED_FUNC(truncf,
"frintz s0, s0\n\t"
"ret")