From 565a2c4c1d1cc7b63670861c65b35baf0864e053 Mon Sep 17 00:00:00 2001 From: Justin Miller Date: Mon, 30 May 2022 12:28:17 -0700 Subject: [PATCH] [SDK] stub some of CRT for arm64 --- sdk/include/crt/intrin.h | 2 +- sdk/lib/cpprt/CMakeLists.txt | 2 + sdk/lib/cpprt/arm64/cpprt.s | 18 +++++ sdk/lib/crt/except/arm64/chkstk_asm.s | 3 +- sdk/lib/crt/except/arm64/cpp.s | 105 ++++++++++++++++++++++++++ sdk/lib/crt/except/except.cmake | 14 ++++ sdk/lib/crt/math/arm64/__rt_sdiv64.s | 20 +++++ sdk/lib/crt/math/arm64/__rt_srsh.s | 20 +++++ sdk/lib/crt/math/arm64/__rt_udiv64.s | 20 +++++ sdk/lib/crt/math/arm64/_logb.s | 20 +++++ sdk/lib/crt/math/arm64/atan.s | 21 ++++++ sdk/lib/crt/math/arm64/atan2.s | 10 ++- sdk/lib/crt/math/arm64/ceil.s | 21 ++++++ sdk/lib/crt/math/arm64/exp.s | 20 +++++ sdk/lib/crt/math/arm64/fabs.s | 20 +++++ sdk/lib/crt/math/arm64/floor.s | 20 +++++ sdk/lib/crt/math/arm64/fmod.s | 20 +++++ sdk/lib/crt/math/arm64/ldexp.s | 20 +++++ sdk/lib/crt/math/arm64/log.s | 20 +++++ sdk/lib/crt/math/arm64/log10.s | 20 +++++ sdk/lib/crt/math/arm64/pow.s | 20 +++++ sdk/lib/crt/math/arm64/tan.s | 21 ++++++ sdk/lib/crt/math/math.cmake | 45 +++++++++++ sdk/lib/crt/msvcrtex.cmake | 24 ++++++ 24 files changed, 520 insertions(+), 6 deletions(-) create mode 100644 sdk/lib/cpprt/arm64/cpprt.s create mode 100644 sdk/lib/crt/except/arm64/cpp.s create mode 100644 sdk/lib/crt/math/arm64/__rt_sdiv64.s create mode 100644 sdk/lib/crt/math/arm64/__rt_srsh.s create mode 100644 sdk/lib/crt/math/arm64/__rt_udiv64.s create mode 100644 sdk/lib/crt/math/arm64/_logb.s create mode 100644 sdk/lib/crt/math/arm64/atan.s create mode 100644 sdk/lib/crt/math/arm64/ceil.s create mode 100644 sdk/lib/crt/math/arm64/exp.s create mode 100644 sdk/lib/crt/math/arm64/fabs.s create mode 100644 sdk/lib/crt/math/arm64/floor.s create mode 100644 sdk/lib/crt/math/arm64/fmod.s create mode 100644 sdk/lib/crt/math/arm64/ldexp.s create mode 100644 sdk/lib/crt/math/arm64/log.s create mode 100644 sdk/lib/crt/math/arm64/log10.s create mode 100644 sdk/lib/crt/math/arm64/pow.s create mode 100644 sdk/lib/crt/math/arm64/tan.s diff --git a/sdk/include/crt/intrin.h b/sdk/include/crt/intrin.h index 3a03d02fe3e..c9a9529ee83 100644 --- a/sdk/include/crt/intrin.h +++ b/sdk/include/crt/intrin.h @@ -826,7 +826,7 @@ void _mm_stream_si64x(__int64 *, __int64); #endif #endif /* _M_X64 */ -#if defined(_M_ARM) || defined(_M_X64) +#if defined(_M_ARM) || defined(_M_X64) || defined(_M_ARM64) __int64 _InterlockedAnd64(_Interlocked_operand_ __int64 volatile * _Value, __int64 _Mask); __int64 _InterlockedDecrement64(_Interlocked_operand_ __int64 volatile * _Addend); diff --git a/sdk/lib/cpprt/CMakeLists.txt b/sdk/lib/cpprt/CMakeLists.txt index 94632d39ea5..72357b21355 100644 --- a/sdk/lib/cpprt/CMakeLists.txt +++ b/sdk/lib/cpprt/CMakeLists.txt @@ -15,6 +15,8 @@ elseif(ARCH STREQUAL "amd64") add_asm_files(cpprt_asm amd64/cpprt.s) elseif(ARCH STREQUAL "arm") add_asm_files(cpprt_asm arm/cpprt.s) +elseif(ARCH STREQUAL "arm64") + add_asm_files(cpprt_asm arm64/cpprt.s) endif() add_library(cpprt ${SOURCE} ${cpprt_asm}) diff --git a/sdk/lib/cpprt/arm64/cpprt.s b/sdk/lib/cpprt/arm64/cpprt.s new file mode 100644 index 00000000000..5de0b8c77c5 --- /dev/null +++ b/sdk/lib/cpprt/arm64/cpprt.s @@ -0,0 +1,18 @@ +#include + + TEXTAREA + + MACRO + DEFINE_ALIAS $FuncName, $Target + LCLS _FuncName + LCLS _Target +_FuncName SETS "|$FuncName|" +_Target SETS "|$Target|" + IMPORT $_FuncName, WEAK $_Target + MEND + + DEFINE_ALIAS ??3@YAXPEAXAEBUnothrow_t@std@@@Z, ??3@YAXPEAX@Z + DEFINE_ALIAS ??_V@YAXPEAXAEBUnothrow_t@std@@@Z, ??3@YAXPEAX@Z + DEFINE_ALIAS ??3@YAXPEAX_K@Z, ??3@YAXPEAX@Z + + END diff --git a/sdk/lib/crt/except/arm64/chkstk_asm.s b/sdk/lib/crt/except/arm64/chkstk_asm.s index ada72aeb331..ddac43de97c 100644 --- a/sdk/lib/crt/except/arm64/chkstk_asm.s +++ b/sdk/lib/crt/except/arm64/chkstk_asm.s @@ -1,8 +1,7 @@ /* INCLUDES ******************************************************************/ -/* We need one of these first! */ -/* #include */ +#include /* CODE **********************************************************************/ TEXTAREA diff --git a/sdk/lib/crt/except/arm64/cpp.s b/sdk/lib/crt/except/arm64/cpp.s new file mode 100644 index 00000000000..9968ac8bb1a --- /dev/null +++ b/sdk/lib/crt/except/arm64/cpp.s @@ -0,0 +1,105 @@ +/* + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory + * PROJECT: ReactOS CRT library + * PURPOSE: MSVC wrappers for C++ functions + * COPYRIGHT: 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + MACRO + DEFINE_ALIAS $FuncName, $Target + LCLS _FuncName + LCLS _Target +_FuncName SETS "|$FuncName|" +_Target SETS "|$Target|" + IMPORT $_FuncName, WEAK $_Target + MEND + + + DEFINE_ALIAS ??0__non_rtti_object@@QAA@ABV0@@Z, MSVCRT___non_rtti_object_copy_ctor + DEFINE_ALIAS ??0__non_rtti_object@@QAA@PBD@Z, MSVCRT___non_rtti_object_ctor + DEFINE_ALIAS ??0bad_cast@@AAA@PBQBD@Z, MSVCRT_bad_cast_ctor // private: __cdecl bad_cast::bad_cast(char const * const *) + DEFINE_ALIAS ??0bad_cast@@QAA@ABV0@@Z, MSVCRT_bad_cast_copy_ctor // public: __cdecl bad_cast::bad_cast(class bad_cast const &) + DEFINE_ALIAS ??0bad_cast@@QAA@PBD@Z, MSVCRT_bad_cast_ctor // public: __cdecl bad_cast::bad_cast(char const *) + DEFINE_ALIAS ??0bad_typeid@@QAA@ABV0@@Z, MSVCRT_bad_typeid_copy_ctor // public: __cdecl bad_typeid::bad_typeid(class bad_typeid const &) + DEFINE_ALIAS ??0bad_typeid@@QAA@PBD@Z, MSVCRT_bad_typeid_ctor // public: __cdecl bad_typeid::bad_typeid(char const *) + DEFINE_ALIAS ??0exception@@QAA@ABQBD@Z, MSVCRT_exception_ctor // public: __cdecl exception::exception(char const * const &) + DEFINE_ALIAS ??0exception@@QAA@ABQBDH@Z, MSVCRT_exception_ctor_noalloc // public: __cdecl exception::exception(char const * const &,int) + DEFINE_ALIAS ??0exception@@QAA@ABV0@@Z, MSVCRT_exception_copy_ctor // public: __cdecl exception::exception(class exception const &) + DEFINE_ALIAS ??0exception@@QAA@XZ, MSVCRT_exception_default_ctor // public: __cdecl exception::exception(void) + DEFINE_ALIAS ??1__non_rtti_object@@UAA@XZ, MSVCRT___non_rtti_object_dtor // public: virtual __cdecl __non_rtti_object::~__non_rtti_object(void) + DEFINE_ALIAS ??1bad_cast@@UAA@XZ, MSVCRT_bad_cast_dtor // public: virtual __cdecl bad_cast::~bad_cast(void) + DEFINE_ALIAS ??1bad_typeid@@UAA@XZ, MSVCRT_bad_typeid_dtor // public: virtual __cdecl bad_typeid::~bad_typeid(void) + DEFINE_ALIAS ??1exception@@UAA@XZ, MSVCRT_exception_dtor // public: virtual __cdecl exception::~exception(void) + DEFINE_ALIAS ??1type_info@@UAA@XZ, MSVCRT_type_info_dtor // public: virtual __cdecl type_info::~type_info(void) + DEFINE_ALIAS ??2@YAPAXI@Z, MSVCRT_operator_new // void * __cdecl operator new(unsigned int) + DEFINE_ALIAS ??2@YAPAXIHPBDH@Z, MSVCRT_operator_new_dbg // void * __cdecl operator new(unsigned int,int,char const *,int) + DEFINE_ALIAS ??3@YAXPAX@Z, MSVCRT_operator_delete // void __cdecl operator delete(void *) + DEFINE_ALIAS ??4__non_rtti_object@@QAAAAV0@ABV0@@Z, MSVCRT___non_rtti_object_opequals // public: class __non_rtti_object & __cdecl __non_rtti_object::operator=(class __non_rtti_object const &) + DEFINE_ALIAS ??4bad_cast@@QAAAAV0@ABV0@@Z, MSVCRT_bad_cast_opequals // public: class bad_cast & __cdecl bad_cast::operator=(class bad_cast const &) + DEFINE_ALIAS ??4bad_typeid@@QAAAAV0@ABV0@@Z, MSVCRT_bad_typeid_opequals // public: class bad_typeid & __cdecl bad_typeid::operator=(class bad_typeid const &) + DEFINE_ALIAS ??4exception@@QAAAAV0@ABV0@@Z, MSVCRT_exception_opequals // public: class exception & __cdecl exception::operator=(class exception const &) + DEFINE_ALIAS ??8type_info@@QBAHABV0@@Z, MSVCRT_type_info_opequals_equals // public: int __cdecl type_info::operator==(class type_info const &)const + DEFINE_ALIAS ??9type_info@@QBAHABV0@@Z, MSVCRT_type_info_opnot_equals // public: int __cdecl type_info::operator!=(class type_info const &)const + DEFINE_ALIAS ??_Fbad_cast@@QAAXXZ, MSVCRT_bad_cast_default_ctor // public: void __cdecl bad_cast::`default constructor closure'(void) + DEFINE_ALIAS ??_Fbad_typeid@@QAAXXZ, MSVCRT_bad_typeid_default_ctor // public: void __cdecl bad_typeid::`default constructor closure'(void) + DEFINE_ALIAS ??_U@YAPAXI@Z, MSVCRT_operator_new // void * __cdecl operator new[](unsigned int) + DEFINE_ALIAS ??_U@YAPAXIHPBDH@Z, MSVCRT_operator_new_dbg // void * __cdecl operator new[](unsigned int,int,char const *,int) + DEFINE_ALIAS ??_V@YAXPAX@Z, MSVCRT_operator_delete // void __cdecl operator delete[](void *) + DEFINE_ALIAS ?_query_new_handler@@YAP6AHI@ZXZ, MSVCRT__query_new_handler // int (__cdecl*__cdecl _query_new_handler(void))(unsigned int) + DEFINE_ALIAS ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z, MSVCRT__set_new_handler // int (__cdecl*__cdecl _set_new_handler(int (__cdecl*)(unsigned int)))(unsigned int) + DEFINE_ALIAS ?_set_new_mode@@YAHH@Z, MSVCRT__set_new_mode // int __cdecl _set_new_mode(int) + DEFINE_ALIAS ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z, MSVCRT__set_se_translator // void (__cdecl*__cdecl _set_se_translator(void (__cdecl*)(unsigned int,struct _EXCEPTION_POINTERS *)))(unsigned int,struct _EXCEPTION_POINTERS *) + DEFINE_ALIAS ?before@type_info@@QBAHABV1@@Z, MSVCRT_type_info_before // public: int __cdecl type_info::before(class type_info const &)const + DEFINE_ALIAS ?name@type_info@@QBAPBDXZ, MSVCRT_type_info_name // public: char const * __cdecl type_info::name(void)const + DEFINE_ALIAS ?raw_name@type_info@@QBAPBDXZ, MSVCRT_type_info_raw_name // public: char const * __cdecl type_info::raw_name(void)const + DEFINE_ALIAS ?set_terminate@@YAP6AXXZP6AXXZ@Z, MSVCRT_set_terminate // void (__cdecl*__cdecl set_terminate(void (__cdecl*)(void)))(void) + DEFINE_ALIAS ?set_unexpected@@YAP6AXXZP6AXXZ@Z, MSVCRT_set_unexpected // void (__cdecl*__cdecl set_unexpected(void (__cdecl*)(void)))(void) + DEFINE_ALIAS ?terminate@@YAXXZ, MSVCRT_terminate // void __cdecl terminate(void) + DEFINE_ALIAS ?unexpected@@YAXXZ, MSVCRT_unexpected // void __cdecl unexpected(void) + DEFINE_ALIAS ?what@exception@@UBAPBDXZ, MSVCRT_what_exception // public: virtual char const * __cdecl exception::what(void)const + + #undef _MSVCRT_ + MACRO + START_VTABLE $ShortName, $CxxName + LCLS RttiName + LCLS VtblName + LCLS DtorName + LCLS CxxLabel +CxxLabel SETS "|$CxxName|" +RttiName SETS "|$ShortName._rtti|" +VtblName SETS "|MSVCRT_":CC:"$ShortName._vtable|" +DtorName SETS "|MSVCRT_":CC:"$ShortName._vector_dtor|" + EXTERN $RttiName + DCD $RttiName + EXPORT $VtblName +$VtblName + EXPORT $CxxLabel +$CxxLabel + EXTERN $DtorName + DCD $DtorName + MEND + + MACRO + DEFINE_EXCEPTION_VTABLE $ShortName, $CxxName + START_VTABLE $ShortName, $CxxName + EXTERN MSVCRT_what_exception + DCD MSVCRT_what_exception + MEND + + START_VTABLE type_info, __dummyname_type_info + DEFINE_EXCEPTION_VTABLE exception, ??_7exception@@6B@ + DEFINE_EXCEPTION_VTABLE bad_typeid, ??_7bad_typeid@@6B@ + DEFINE_EXCEPTION_VTABLE bad_cast, ??_7bad_cast@@6B@ + DEFINE_EXCEPTION_VTABLE __non_rtti_object, ??_7__non_rtti_object@@6B@ + + GBLS FuncName + + END diff --git a/sdk/lib/crt/except/except.cmake b/sdk/lib/crt/except/except.cmake index 656853c097c..10a23f1c6a8 100644 --- a/sdk/lib/crt/except/except.cmake +++ b/sdk/lib/crt/except/except.cmake @@ -55,6 +55,20 @@ elseif(ARCH STREQUAL "arm") list(APPEND CRT_EXCEPT_ASM_SOURCE except/arm/cpp.s) endif() +elseif(ARCH STREQUAL "arm64") + list(APPEND LIBCNTPR_EXCEPT_SOURCE + except/arm/ehandler.c + ) + list(APPEND LIBCNTPR_EXCEPT_ASM_SOURCE + except/arm64/chkstk_asm.s + ) + list(APPEND CRT_EXCEPT_ASM_SOURCE + except/arm64/chkstk_asm.s + ) + if(MSVC) + list(APPEND CRT_EXCEPT_ASM_SOURCE + except/arm64/cpp.s) + endif() endif() list(APPEND CRT_EXCEPT_SOURCE diff --git a/sdk/lib/crt/math/arm64/__rt_sdiv64.s b/sdk/lib/crt/math/arm64/__rt_sdiv64.s new file mode 100644 index 00000000000..66900e9a6e4 --- /dev/null +++ b/sdk/lib/crt/math/arm64/__rt_sdiv64.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of __rt_sdiv64 + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + NESTED_ENTRY __rt_sdiv64 + NESTED_END __rt_sdiv64 + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/__rt_srsh.s b/sdk/lib/crt/math/arm64/__rt_srsh.s new file mode 100644 index 00000000000..6ff6220a6bf --- /dev/null +++ b/sdk/lib/crt/math/arm64/__rt_srsh.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of __rt_srsh + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY __rt_srsh + LEAF_END __rt_srsh + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/__rt_udiv64.s b/sdk/lib/crt/math/arm64/__rt_udiv64.s new file mode 100644 index 00000000000..f5a146251ff --- /dev/null +++ b/sdk/lib/crt/math/arm64/__rt_udiv64.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of __rt_udiv64 + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + NESTED_ENTRY __rt_udiv64 + NESTED_END __rt_udiv64 + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/_logb.s b/sdk/lib/crt/math/arm64/_logb.s new file mode 100644 index 00000000000..34622fb1427 --- /dev/null +++ b/sdk/lib/crt/math/arm64/_logb.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of _logb + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY _logb + LEAF_END _logb + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/atan.s b/sdk/lib/crt/math/arm64/atan.s new file mode 100644 index 00000000000..d801931407e --- /dev/null +++ b/sdk/lib/crt/math/arm64/atan.s @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory + * PROJECT: ReactOS CRT library + * PURPOSE: Implementation of atan + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY atan + + LEAF_END atan + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/atan2.s b/sdk/lib/crt/math/arm64/atan2.s index f5848fab3f9..5d8ae9634ee 100644 --- a/sdk/lib/crt/math/arm64/atan2.s +++ b/sdk/lib/crt/math/arm64/atan2.s @@ -1,15 +1,19 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of atan2 + * COPYRIGHT: Copyright 2022 Justin Miller + */ /* INCLUDES ******************************************************************/ -/* We need one of these first! */ -/* #include */ +#include /* CODE **********************************************************************/ TEXTAREA LEAF_ENTRY atan2 - /* TODO: add an assert fail call, as this is unimplemented */ LEAF_END atan2 END diff --git a/sdk/lib/crt/math/arm64/ceil.s b/sdk/lib/crt/math/arm64/ceil.s new file mode 100644 index 00000000000..04a207b78e5 --- /dev/null +++ b/sdk/lib/crt/math/arm64/ceil.s @@ -0,0 +1,21 @@ +/* +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of ceil + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY ceil + LEAF_END ceil + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/exp.s b/sdk/lib/crt/math/arm64/exp.s new file mode 100644 index 00000000000..6a16b6273be --- /dev/null +++ b/sdk/lib/crt/math/arm64/exp.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of exp + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY exp + LEAF_END exp + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/fabs.s b/sdk/lib/crt/math/arm64/fabs.s new file mode 100644 index 00000000000..93ee7fc1485 --- /dev/null +++ b/sdk/lib/crt/math/arm64/fabs.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of fabs + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY fabs + LEAF_END fabs + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/floor.s b/sdk/lib/crt/math/arm64/floor.s new file mode 100644 index 00000000000..a53166c4f12 --- /dev/null +++ b/sdk/lib/crt/math/arm64/floor.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of floor + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY floor + LEAF_END floor + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/fmod.s b/sdk/lib/crt/math/arm64/fmod.s new file mode 100644 index 00000000000..a443de43ddb --- /dev/null +++ b/sdk/lib/crt/math/arm64/fmod.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of fmod + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY fmod + LEAF_END fmod + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/ldexp.s b/sdk/lib/crt/math/arm64/ldexp.s new file mode 100644 index 00000000000..3f47bb83e4c --- /dev/null +++ b/sdk/lib/crt/math/arm64/ldexp.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of ldexp + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY ldexp + LEAF_END ldexp + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/log.s b/sdk/lib/crt/math/arm64/log.s new file mode 100644 index 00000000000..fc54c09f93d --- /dev/null +++ b/sdk/lib/crt/math/arm64/log.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of log + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY log + LEAF_END log + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/log10.s b/sdk/lib/crt/math/arm64/log10.s new file mode 100644 index 00000000000..ab4e4d9b918 --- /dev/null +++ b/sdk/lib/crt/math/arm64/log10.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of log10 + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY log10 + LEAF_END log10 + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/pow.s b/sdk/lib/crt/math/arm64/pow.s new file mode 100644 index 00000000000..7401e2839a3 --- /dev/null +++ b/sdk/lib/crt/math/arm64/pow.s @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of pow + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY pow + LEAF_END pow + + END +/* EOF */ diff --git a/sdk/lib/crt/math/arm64/tan.s b/sdk/lib/crt/math/arm64/tan.s new file mode 100644 index 00000000000..f066b07c491 --- /dev/null +++ b/sdk/lib/crt/math/arm64/tan.s @@ -0,0 +1,21 @@ +/* + * PROJECT: ReactOS CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of tan + * COPYRIGHT: Copyright 2022 Justin Miller + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* CODE **********************************************************************/ + + TEXTAREA + + LEAF_ENTRY tan + + LEAF_END tan + + END +/* EOF */ diff --git a/sdk/lib/crt/math/math.cmake b/sdk/lib/crt/math/math.cmake index a888242644e..90c6f53e38b 100644 --- a/sdk/lib/crt/math/math.cmake +++ b/sdk/lib/crt/math/math.cmake @@ -199,6 +199,51 @@ elseif(ARCH STREQUAL "arm") list(APPEND CRT_MATH_ASM_SOURCE math/arm/_logb.s ) +elseif(ARCH STREQUAL "arm64") + list(APPEND LIBCNTPR_MATH_SOURCE + math/cos.c + math/floorf.c + math/sin.c + math/sqrt.c + math/arm/__rt_sdiv.c + math/arm/__rt_sdiv64_worker.c + math/arm/__rt_udiv.c + math/arm/__rt_udiv64_worker.c + math/arm/__rt_div_worker.h + math/arm/__dtoi64.c + math/arm/__dtou64.c + math/arm/__stoi64.c + math/arm/__stou64.c + math/arm/__fto64.h + math/arm/__i64tod.c + math/arm/__u64tod.c + math/arm/__i64tos.c + math/arm/__u64tos.c + math/arm/__64tof.h + ) + list(APPEND CRT_MATH_SOURCE + math/fabsf.c + ) + list(APPEND LIBCNTPR_MATH_ASM_SOURCE + math/arm64/atan.s + math/arm64/atan2.s + math/arm64/ceil.s + math/arm64/exp.s + math/arm64/fabs.s + math/arm64/fmod.s + math/arm64/floor.s + math/arm64/ldexp.s + math/arm64/log.s + math/arm64/log10.s + math/arm64/pow.s + math/arm64/tan.s + math/arm64/__rt_sdiv64.s + math/arm64/__rt_srsh.s + math/arm64/__rt_udiv64.s + ) + list(APPEND CRT_MATH_ASM_SOURCE + math/arm64/_logb.s + ) endif() if(NOT ARCH STREQUAL "i386") diff --git a/sdk/lib/crt/msvcrtex.cmake b/sdk/lib/crt/msvcrtex.cmake index 4ecfd4db6f8..bf19ece5eec 100644 --- a/sdk/lib/crt/msvcrtex.cmake +++ b/sdk/lib/crt/msvcrtex.cmake @@ -74,6 +74,30 @@ elseif(ARCH STREQUAL "arm") math/arm/__rt_srsh.s math/arm/__rt_udiv64.s ) +elseif(ARCH STREQUAL "arm64") + list(APPEND MSVCRTEX_SOURCE + math/arm/__rt_sdiv.c + math/arm/__rt_sdiv64_worker.c + math/arm/__rt_udiv.c + math/arm/__rt_udiv64_worker.c + math/arm/__rt_div_worker.h + math/arm/__dtoi64.c + math/arm/__dtou64.c + math/arm/__stoi64.c + math/arm/__stou64.c + math/arm/__fto64.h + math/arm/__i64tod.c + math/arm/__u64tod.c + math/arm/__i64tos.c + math/arm/__u64tos.c + math/arm/__64tof.h + ) + list(APPEND MSVCRTEX_ASM_SOURCE + except/arm64/chkstk_asm.s + math/arm64/__rt_sdiv64.s + math/arm64/__rt_srsh.s + math/arm64/__rt_udiv64.s + ) endif() set_source_files_properties(${MSVCRTEX_ASM_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_DLL;_MSVCRTEX_")