From c773c75e56778f100fddbde9ba9f4d49296a56c7 Mon Sep 17 00:00:00 2001 From: Adeel Date: Thu, 20 Aug 2020 21:05:25 +0300 Subject: [PATCH] Convert Math{F}.CoreCLR methods from FCall to QCall --- eng/DefaultGenApiDocIds.txt | 1 + .../src/System/Math.CoreCLR.cs | 95 +++-- .../src/System/MathF.CoreCLR.cs | 86 +++-- src/coreclr/src/classlibnative/CMakeLists.txt | 1 - .../src/classlibnative/float/CMakeLists.txt | 18 - .../src/classlibnative/float/floatdouble.cpp | 331 ------------------ .../src/classlibnative/float/floatsingle.cpp | 318 ----------------- .../src/classlibnative/inc/floatdouble.h | 42 --- .../src/classlibnative/inc/floatsingle.h | 42 --- .../src/classlibnative/inc/mathfuncs.h | 20 ++ .../src/dlls/mscoree/coreclr/CMakeLists.txt | 1 - src/coreclr/src/vm/corelib.cpp | 3 +- src/coreclr/src/vm/ecall.cpp | 10 - src/coreclr/src/vm/ecalllist.h | 125 +++---- 14 files changed, 202 insertions(+), 891 deletions(-) delete mode 100644 src/coreclr/src/classlibnative/float/CMakeLists.txt delete mode 100644 src/coreclr/src/classlibnative/float/floatdouble.cpp delete mode 100644 src/coreclr/src/classlibnative/float/floatsingle.cpp delete mode 100644 src/coreclr/src/classlibnative/inc/floatdouble.h delete mode 100644 src/coreclr/src/classlibnative/inc/floatsingle.h create mode 100644 src/coreclr/src/classlibnative/inc/mathfuncs.h diff --git a/eng/DefaultGenApiDocIds.txt b/eng/DefaultGenApiDocIds.txt index dc6867fbba2a4c..bbc8e7893aca38 100644 --- a/eng/DefaultGenApiDocIds.txt +++ b/eng/DefaultGenApiDocIds.txt @@ -33,6 +33,7 @@ T:System.Runtime.InteropServices.ComVisibleAttribute T:System.Runtime.InteropServices.GuidAttribute T:System.Runtime.InteropServices.LCIDConversionAttribute T:System.Runtime.InteropServices.StructLayoutAttribute +T:System.Runtime.InteropServices.SuppressGCTransitionAttribute T:System.Security.Permissions.EnvironmentPermissionAttribute T:System.Security.Permissions.FileIOPermissionAttribute T:System.Security.Permissions.HostProtectionAttribute diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Math.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Math.CoreCLR.cs index beeb322b52c0cd..5c45939d2c29b9 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Math.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Math.CoreCLR.cs @@ -11,119 +11,154 @@ ===========================================================*/ using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; namespace System { public static partial class Math { +#pragma warning disable CA1401 // P/Invokes should not be visible + [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Abs(double value); + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] + private static extern float AbsF(float value); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Abs(float value); + public static float Abs(float value) => AbsF(value); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Acos(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Acosh(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Asin(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Asinh(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Atan(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Atan2(double y, double x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Atanh(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Cbrt(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Ceiling(double a); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Cos(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Cosh(double value); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Exp(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Floor(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double FusedMultiplyAdd(double x, double y, double z); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern int ILogB(double x); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Log(double d); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Log2(double x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Log10(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Pow(double x, double y); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double ScaleB(double x, int n); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Sin(double a); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Sinh(double value); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Sqrt(double d); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Tan(double a); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern double Tanh(double value); - [MethodImpl(MethodImplOptions.InternalCall)] +#pragma warning restore CA1401 // P/Invokes should not be visible + + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] private static extern double FMod(double x, double y); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] private static extern unsafe double ModF(double x, double* intptr); } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/MathF.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/MathF.CoreCLR.cs index f3dd3289c1c26d..f3236f6f1e058e 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/MathF.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/MathF.CoreCLR.cs @@ -8,111 +8,143 @@ ===========================================================*/ using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; namespace System { public static partial class MathF { +#pragma warning disable CA1401 // P/Invokes should not be visible + [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Acos(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Acosh(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Asin(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Asinh(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Atan(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Atan2(float y, float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Atanh(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Cbrt(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Ceiling(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Cos(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Cosh(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Exp(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Floor(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float FusedMultiplyAdd(float x, float y, float z); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern int ILogB(float x); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Log(float x); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Log2(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Log10(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Pow(float x, float y); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float ScaleB(float x, int n); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Sin(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Sinh(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Sqrt(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Tan(float x); [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] public static extern float Tanh(float x); - [MethodImpl(MethodImplOptions.InternalCall)] +#pragma warning restore CA1401 // P/Invokes should not be visible + + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] private static extern float FMod(float x, float y); - [MethodImpl(MethodImplOptions.InternalCall)] + [SuppressGCTransition] + [DllImport(RuntimeHelpers.QCall, CallingConvention = CallingConvention.Cdecl)] private static extern unsafe float ModF(float x, float* intptr); } } diff --git a/src/coreclr/src/classlibnative/CMakeLists.txt b/src/coreclr/src/classlibnative/CMakeLists.txt index aeaba89b82bd75..a27c4093ed3def 100644 --- a/src/coreclr/src/classlibnative/CMakeLists.txt +++ b/src/coreclr/src/classlibnative/CMakeLists.txt @@ -5,4 +5,3 @@ include_directories("../debug/inc") include_directories("../debug/inc/dump") add_subdirectory(bcltype) -add_subdirectory(float) diff --git a/src/coreclr/src/classlibnative/float/CMakeLists.txt b/src/coreclr/src/classlibnative/float/CMakeLists.txt deleted file mode 100644 index b2c47ea39b65ea..00000000000000 --- a/src/coreclr/src/classlibnative/float/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -include_directories("../inc") - -set(FLOAT_SOURCES - floatdouble.cpp - floatsingle.cpp -) - -add_library_clr(comfloat_wks_obj - OBJECT - ${FLOAT_SOURCES} -) - -add_dependencies(comfloat_wks_obj eventing_headers) - -add_library(comfloat_wks INTERFACE) -target_sources(comfloat_wks INTERFACE $) \ No newline at end of file diff --git a/src/coreclr/src/classlibnative/float/floatdouble.cpp b/src/coreclr/src/classlibnative/float/floatdouble.cpp deleted file mode 100644 index a2a00b0628bd16..00000000000000 --- a/src/coreclr/src/classlibnative/float/floatdouble.cpp +++ /dev/null @@ -1,331 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// -// File: FloatDouble.cpp -// - -#include - -#include "floatdouble.h" - -// The default compilation mode is /fp:precise, which disables floating-point intrinsics. This -// default compilation mode has previously caused performance regressions in floating-point code. -// We enable /fp:fast semantics for the majority of the math functions, as it will speed up performance -// and is really unlikely to cause any other code regressions. - -// Sin, Cos, and Tan on AMD64 Windows were previously implemented in vm\amd64\JitHelpers_Fast.asm -// by calling x87 floating point code (fsin, fcos, fptan) because the CRT helpers were too slow. This -// is no longer the case and the CRT call is used on all platforms. - -// Log, Log10 and Exp were previously slower with /fp:fast on SSE2 enabled hardware (see #500373). -// This is no longer the case and they now consume use the /fp:fast versions. - -// Exp(+/-INFINITY) did not previously return the expected results of +0.0 (for -INFINITY) -// and +INFINITY (for +INFINITY) so these cases were handled specially. As this is no longer -// the case and the expected results are now returned, the special handling has been removed. - -// Previously there was more special handling for the x86 Windows version of Pow. -// This additional handling was unnecessary and has since been removed. - -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -/// -/// beginning of /fp:fast scope -/// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// - -#ifdef _MSC_VER -#pragma float_control(push) -#pragma float_control(precise, off) -#endif - -/*=====================================Abs====================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Abs, double x) - FCALL_CONTRACT; - - return (double)fabs(x); -FCIMPLEND - -/*=====================================Acos===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Acos, double x) - FCALL_CONTRACT; - - return (double)acos(x); -FCIMPLEND - -/*=====================================Acosh==================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Acosh, double x) - FCALL_CONTRACT; - - return (double)acosh(x); -FCIMPLEND - -/*=====================================Asin===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Asin, double x) - FCALL_CONTRACT; - - return (double)asin(x); -FCIMPLEND - -/*=====================================Asinh==================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Asinh, double x) - FCALL_CONTRACT; - - return (double)asinh(x); -FCIMPLEND - -/*=====================================Atan===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Atan, double x) - FCALL_CONTRACT; - - return (double)atan(x); -FCIMPLEND - -/*=====================================Atanh==================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Atanh, double x) - FCALL_CONTRACT; - - return (double)atanh(x); -FCIMPLEND - -/*=====================================Atan2==================================== -** -==============================================================================*/ -FCIMPL2_VV(double, COMDouble::Atan2, double y, double x) - FCALL_CONTRACT; - - return (double)atan2(y, x); -FCIMPLEND - -/*====================================Cbrt====================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Cbrt, double x) - FCALL_CONTRACT; - - return (double)cbrt(x); -FCIMPLEND - -#if defined(_MSC_VER) && defined(TARGET_AMD64) -// The /fp:fast form of `ceil` for AMD64 does not correctly handle: `-1.0 < value <= -0.0` -// https://github.com/dotnet/runtime/issues/11003 -#pragma float_control(push) -#pragma float_control(precise, on) -#endif - -/*====================================Ceil====================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Ceil, double x) - FCALL_CONTRACT; - - return (double)ceil(x); -FCIMPLEND - -#if defined(_MSC_VER) && defined(TARGET_AMD64) -#pragma float_control(pop) -#endif - -/*=====================================Cos====================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Cos, double x) - FCALL_CONTRACT; - - return (double)cos(x); -FCIMPLEND - -/*=====================================Cosh===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Cosh, double x) - FCALL_CONTRACT; - - return (double)cosh(x); -FCIMPLEND - -/*=====================================Exp====================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Exp, double x) - FCALL_CONTRACT; - - return (double)exp(x); -FCIMPLEND - -#if defined(_MSC_VER) && defined(TARGET_X86) -// The /fp:fast form of `floor` for x86 does not correctly handle: `-0.0` -// https://github.com/dotnet/runtime/issues/11003 -#pragma float_control(push) -#pragma float_control(precise, on) -#endif - -/*====================================Floor===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Floor, double x) - FCALL_CONTRACT; - - return (double)floor(x); -FCIMPLEND - -#if defined(_MSC_VER) && defined(TARGET_X86) -#pragma float_control(pop) -#endif - -/*=====================================FMod===================================== -** -==============================================================================*/ -FCIMPL2_VV(double, COMDouble::FMod, double x, double y) - FCALL_CONTRACT; - - return (double)fmod(x, y); -FCIMPLEND - -/*=====================================FusedMultiplyAdd========================== -** -==============================================================================*/ -FCIMPL3_VVV(double, COMDouble::FusedMultiplyAdd, double x, double y, double z) - FCALL_CONTRACT; - - return (double)fma(x, y, z); -FCIMPLEND - -/*=====================================Ilog2==================================== -** -==============================================================================*/ -FCIMPL1_V(int, COMDouble::ILogB, double x) - FCALL_CONTRACT; - - return (int)ilogb(x); -FCIMPLEND - -/*=====================================Log====================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Log, double x) - FCALL_CONTRACT; - - return (double)log(x); -FCIMPLEND - -/*=====================================Log2===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Log2, double x) - FCALL_CONTRACT; - - return (double)log2(x); -FCIMPLEND - -/*====================================Log10===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Log10, double x) - FCALL_CONTRACT; - - return (double)log10(x); -FCIMPLEND - -/*=====================================ModF===================================== -** -==============================================================================*/ -FCIMPL2_VI(double, COMDouble::ModF, double x, double* intptr) - FCALL_CONTRACT; - - return (double)modf(x, intptr); -FCIMPLEND - -/*=====================================Pow====================================== -** -==============================================================================*/ -FCIMPL2_VV(double, COMDouble::Pow, double x, double y) - FCALL_CONTRACT; - - return (double)pow(x, y); -FCIMPLEND - -/*=====================================ScaleB=================================== -** -==============================================================================*/ -FCIMPL2_VI(double, COMDouble::ScaleB, double x, int n) - FCALL_CONTRACT; - - return (double)scalbn(x, n); -FCIMPLEND - -/*=====================================Sin====================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Sin, double x) - FCALL_CONTRACT; - - return (double)sin(x); -FCIMPLEND - -/*=====================================Sinh===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Sinh, double x) - FCALL_CONTRACT; - - return (double)sinh(x); -FCIMPLEND - -/*=====================================Sqrt===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Sqrt, double x) - FCALL_CONTRACT; - - return (double)sqrt(x); -FCIMPLEND - -/*=====================================Tan====================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Tan, double x) - FCALL_CONTRACT; - - return (double)tan(x); -FCIMPLEND - -/*=====================================Tanh===================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Tanh, double x) - FCALL_CONTRACT; - - return (double)tanh(x); -FCIMPLEND - -#ifdef _MSC_VER -#pragma float_control(pop) -#endif - -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -/// -/// End of /fp:fast scope -/// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// diff --git a/src/coreclr/src/classlibnative/float/floatsingle.cpp b/src/coreclr/src/classlibnative/float/floatsingle.cpp deleted file mode 100644 index 9972e17c6901b4..00000000000000 --- a/src/coreclr/src/classlibnative/float/floatsingle.cpp +++ /dev/null @@ -1,318 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// -// File: FloatSingle.cpp -// - -#include - -#include "floatsingle.h" - -// Windows x86 and Windows ARM/ARM64 may not define _isnanf() or _copysignf() but they do -// define _isnan() and _copysign(). We will redirect the macros to these other functions if -// the macro is not defined for the platform. This has the side effect of a possible implicit -// upcasting for arguments passed in and an explicit downcasting for the _copysign() call. -#if (defined(TARGET_X86) || defined(TARGET_ARM) || defined(TARGET_ARM64)) && !defined(TARGET_UNIX) - -#if !defined(_copysignf) -#define _copysignf (float)_copysign -#endif - -#endif - -// The default compilation mode is /fp:precise, which disables floating-point intrinsics. This -// default compilation mode has previously caused performance regressions in floating-point code. -// We enable /fp:fast semantics for the majority of the math functions, as it will speed up performance -// and is really unlikely to cause any other code regressions. - -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -/// -/// beginning of /fp:fast scope -/// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// - -#ifdef _MSC_VER -#pragma float_control(push) -#pragma float_control(precise, off) -#endif - -/*=====================================Abs===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Abs, float x) - FCALL_CONTRACT; - - return (float)fabsf(x); -FCIMPLEND - -/*=====================================Acos===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Acos, float x) - FCALL_CONTRACT; - - return (float)acosf(x); -FCIMPLEND - -/*=====================================Acosh==================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Acosh, float x) - FCALL_CONTRACT; - - return (float)acoshf(x); -FCIMPLEND - -/*=====================================Asin===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Asin, float x) - FCALL_CONTRACT; - - return (float)asinf(x); -FCIMPLEND - -/*=====================================Asinh==================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Asinh, float x) - FCALL_CONTRACT; - - return (float)asinhf(x); -FCIMPLEND - -/*=====================================Atan===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Atan, float x) - FCALL_CONTRACT; - - return (float)atanf(x); -FCIMPLEND - -/*=====================================Atanh==================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Atanh, float x) - FCALL_CONTRACT; - - return (float)atanhf(x); -FCIMPLEND - -/*=====================================Atan2==================================== -** -==============================================================================*/ -FCIMPL2_VV(float, COMSingle::Atan2, float y, float x) - FCALL_CONTRACT; - - return (float)atan2f(y, x); -FCIMPLEND - -/*====================================Cbrt====================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Cbrt, float x) - FCALL_CONTRACT; - - return (float)cbrtf(x); -FCIMPLEND - -#if defined(_MSC_VER) && defined(TARGET_AMD64) -// The /fp:fast form of `ceilf` for AMD64 does not correctly handle: `-1.0 < value <= -0.0` -// https://github.com/dotnet/runtime/issues/11003 -#pragma float_control(push) -#pragma float_control(precise, on) -#endif - -/*====================================Ceil====================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Ceil, float x) - FCALL_CONTRACT; - - return (float)ceilf(x); -FCIMPLEND - -#if defined(_MSC_VER) && defined(TARGET_AMD64) -#pragma float_control(pop) -#endif - -/*=====================================Cos====================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Cos, float x) - FCALL_CONTRACT; - - return (float)cosf(x); -FCIMPLEND - -/*=====================================Cosh===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Cosh, float x) - FCALL_CONTRACT; - - return (float)coshf(x); -FCIMPLEND - -/*=====================================Exp====================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Exp, float x) - FCALL_CONTRACT; - - return (float)expf(x); -FCIMPLEND - -/*====================================Floor===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Floor, float x) - FCALL_CONTRACT; - - return (float)floorf(x); -FCIMPLEND - -/*=====================================FMod===================================== -** -==============================================================================*/ -FCIMPL2_VV(float, COMSingle::FMod, float x, float y) - FCALL_CONTRACT; - - return (float)fmodf(x, y); -FCIMPLEND - -/*=====================================FusedMultiplyAdd========================== -** -==============================================================================*/ -FCIMPL3_VVV(float, COMSingle::FusedMultiplyAdd, float x, float y, float z) - FCALL_CONTRACT; - - return (float)fmaf(x, y, z); -FCIMPLEND - -/*=====================================Ilog2==================================== -** -==============================================================================*/ -FCIMPL1_V(int, COMSingle::ILogB, float x) - FCALL_CONTRACT; - - return (int)ilogbf(x); -FCIMPLEND - -/*=====================================Log====================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Log, float x) - FCALL_CONTRACT; - - return (float)logf(x); -FCIMPLEND - -/*=====================================Log2===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Log2, float x) - FCALL_CONTRACT; - - return (float)log2f(x); -FCIMPLEND - -/*====================================Log10===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Log10, float x) - FCALL_CONTRACT; - - return (float)log10f(x); -FCIMPLEND - -/*=====================================ModF===================================== -** -==============================================================================*/ -FCIMPL2_VI(float, COMSingle::ModF, float x, float* intptr) - FCALL_CONTRACT; - - return (float)modff(x, intptr); -FCIMPLEND - -/*=====================================Pow====================================== -** -==============================================================================*/ -FCIMPL2_VV(float, COMSingle::Pow, float x, float y) - FCALL_CONTRACT; - - return (float)powf(x, y); -FCIMPLEND - -/*=====================================ScaleB=================================== -** -==============================================================================*/ -FCIMPL2_VI(float, COMSingle::ScaleB, float x, int n) - FCALL_CONTRACT; - - return (float)scalbnf(x, n); -FCIMPLEND - -/*=====================================Sin====================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Sin, float x) - FCALL_CONTRACT; - - return (float)sinf(x); -FCIMPLEND - -/*=====================================Sinh===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Sinh, float x) - FCALL_CONTRACT; - - return (float)sinhf(x); -FCIMPLEND - -/*=====================================Sqrt===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Sqrt, float x) - FCALL_CONTRACT; - - return (float)sqrtf(x); -FCIMPLEND - -/*=====================================Tan====================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Tan, float x) - FCALL_CONTRACT; - - return (float)tanf(x); -FCIMPLEND - -/*=====================================Tanh===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Tanh, float x) - FCALL_CONTRACT; - - return (float)tanhf(x); -FCIMPLEND - -#ifdef _MSC_VER -#pragma float_control(pop) -#endif - -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -/// -/// End of /fp:fast scope -/// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////// diff --git a/src/coreclr/src/classlibnative/inc/floatdouble.h b/src/coreclr/src/classlibnative/inc/floatdouble.h deleted file mode 100644 index eb430409b6fa5b..00000000000000 --- a/src/coreclr/src/classlibnative/inc/floatdouble.h +++ /dev/null @@ -1,42 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#ifndef _FLOATDOUBLE_H_ -#define _FLOATDOUBLE_H_ - -#include -#include - -class COMDouble { -public: - FCDECL1_V(static double, Abs, double x); - FCDECL1_V(static double, Acos, double x); - FCDECL1_V(static double, Acosh, double x); - FCDECL1_V(static double, Asin, double x); - FCDECL1_V(static double, Asinh, double x); - FCDECL1_V(static double, Atan, double x); - FCDECL1_V(static double, Atanh, double x); - FCDECL2_VV(static double, Atan2, double y, double x); - FCDECL1_V(static double, Cbrt, double x); - FCDECL1_V(static double, Ceil, double x); - FCDECL1_V(static double, Cos, double x); - FCDECL1_V(static double, Cosh, double x); - FCDECL1_V(static double, Exp, double x); - FCDECL1_V(static double, Floor, double x); - FCDECL2_VV(static double, FMod, double x, double y); - FCDECL3_VVV(static double, FusedMultiplyAdd, double x, double y, double z); - FCDECL1_V(static int, ILogB, double x); - FCDECL1_V(static double, Log, double x); - FCDECL1_V(static double, Log2, double x); - FCDECL1_V(static double, Log10, double x); - FCDECL2_VI(static double, ModF, double x, double* intptr); - FCDECL2_VV(static double, Pow, double x, double y); - FCDECL2_VI(static double, ScaleB, double x, int n); - FCDECL1_V(static double, Sin, double x); - FCDECL1_V(static double, Sinh, double x); - FCDECL1_V(static double, Sqrt, double x); - FCDECL1_V(static double, Tan, double x); - FCDECL1_V(static double, Tanh, double x); -}; - -#endif // _FLOATDOUBLE_H_ diff --git a/src/coreclr/src/classlibnative/inc/floatsingle.h b/src/coreclr/src/classlibnative/inc/floatsingle.h deleted file mode 100644 index 2658cb08edd81d..00000000000000 --- a/src/coreclr/src/classlibnative/inc/floatsingle.h +++ /dev/null @@ -1,42 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#ifndef _FLOATSINGLE_H_ -#define _FLOATSINGLE_H_ - -#include -#include - -class COMSingle { -public: - FCDECL1_V(static float, Abs, float x); - FCDECL1_V(static float, Acos, float x); - FCDECL1_V(static float, Acosh, float x); - FCDECL1_V(static float, Asin, float x); - FCDECL1_V(static float, Asinh, float x); - FCDECL1_V(static float, Atan, float x); - FCDECL1_V(static float, Atanh, float x); - FCDECL2_VV(static float, Atan2, float y, float x); - FCDECL1_V(static float, Cbrt, float x); - FCDECL1_V(static float, Ceil, float x); - FCDECL1_V(static float, Cos, float x); - FCDECL1_V(static float, Cosh, float x); - FCDECL1_V(static float, Exp, float x); - FCDECL1_V(static float, Floor, float x); - FCDECL2_VV(static float, FMod, float x, float y); - FCDECL3_VVV(static float, FusedMultiplyAdd, float x, float y, float z); - FCDECL1_V(static int, ILogB, float x); - FCDECL1_V(static float, Log, float x); - FCDECL1_V(static float, Log2, float x); - FCDECL1_V(static float, Log10, float x); - FCDECL2_VI(static float, ModF, float x, float* intptr); - FCDECL2_VV(static float, Pow, float x, float y); - FCDECL2_VI(static float, ScaleB, float x, int n); - FCDECL1_V(static float, Sin, float x); - FCDECL1_V(static float, Sinh, float x); - FCDECL1_V(static float, Sqrt, float x); - FCDECL1_V(static float, Tan, float x); - FCDECL1_V(static float, Tanh, float x); -}; - -#endif // _FLOATSINGLE_H_ diff --git a/src/coreclr/src/classlibnative/inc/mathfuncs.h b/src/coreclr/src/classlibnative/inc/mathfuncs.h new file mode 100644 index 00000000000000..5c98aaf3a50900 --- /dev/null +++ b/src/coreclr/src/classlibnative/inc/mathfuncs.h @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#if defined(TARGET_WINDOWS) && defined(TARGET_ARM64) + +// Workaround Windows ARM64 CRT bug + +double fma_workaround(double x, double y, double z) +{ + return fma(x, y, z); +} +#define fma fma_workaround + +float fmaf_workaround(float x, float y, float z) +{ + return fmaf(x, y, z); +} +#define fmaf fmaf_workaround + +#endif diff --git a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt index 2a25b2119b366b..e1026ba73a5261 100644 --- a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -103,7 +103,6 @@ set(CORECLR_LIBRARIES mdhotdata_full bcltype ceefgen - comfloat_wks corguids gcinfo ildbsymlib diff --git a/src/coreclr/src/vm/corelib.cpp b/src/coreclr/src/vm/corelib.cpp index 4562e2e12ed28d..09cd39d973b8bd 100644 --- a/src/coreclr/src/vm/corelib.cpp +++ b/src/coreclr/src/vm/corelib.cpp @@ -38,8 +38,7 @@ #include "system.h" #include "comutilnative.h" #include "comsynchronizable.h" -#include "floatdouble.h" -#include "floatsingle.h" +#include "mathfuncs.h" #include "comdatetime.h" #include "compatibilityswitch.h" #include "debugdebugger.h" diff --git a/src/coreclr/src/vm/ecall.cpp b/src/coreclr/src/vm/ecall.cpp index a86d12c4b434a1..5daf35c9d66add 100644 --- a/src/coreclr/src/vm/ecall.cpp +++ b/src/coreclr/src/vm/ecall.cpp @@ -713,16 +713,6 @@ LPVOID ECall::GetQCallImpl(MethodDesc * pMD) CONSISTENCY_CHECK_MSGF(cur->IsQCall(), ("%s::%s is not registered using QCFuncElement macro in ecall.cpp", pMD->m_pszDebugClassName, pMD->m_pszDebugMethodName)); - - DWORD dwAttrs = pMD->GetAttrs(); - BOOL fPublicOrProtected = IsMdPublic(dwAttrs) || IsMdFamily(dwAttrs) || IsMdFamORAssem(dwAttrs); - - // SuppressUnmanagedCodeSecurityAttribute on QCalls suppresses a full demand, but there's still a link demand - // for unmanaged code permission. All QCalls should be private or internal and wrapped in a managed method - // to suppress this link demand. - CONSISTENCY_CHECK_MSGF(!fPublicOrProtected, - ("%s::%s has to be private or internal.", - pMD->m_pszDebugClassName, pMD->m_pszDebugMethodName)); #endif return cur->m_pImplementation; diff --git a/src/coreclr/src/vm/ecalllist.h b/src/coreclr/src/vm/ecalllist.h index f1827fa3bd97af..9d8259ea06f549 100644 --- a/src/coreclr/src/vm/ecalllist.h +++ b/src/coreclr/src/vm/ecalllist.h @@ -5,9 +5,6 @@ // This file contains definitions of FCall entrypoints // - - - #ifndef FCFuncElement #define FCFuncElement(name, impl) #endif @@ -58,8 +55,6 @@ // // - - FCFuncStart(gDependentHandleFuncs) FCFuncElement("nInitialize", DependentHandle::nInitialize) FCFuncElement("nGetPrimary", DependentHandle::nGetPrimary) @@ -69,10 +64,6 @@ FCFuncStart(gDependentHandleFuncs) FCFuncElement("nSetSecondary", DependentHandle::nSetSecondary) FCFuncEnd() - - - - FCFuncStart(gEnumFuncs) FCFuncElement("InternalGetUnderlyingType", ReflectionEnum::InternalGetEnumUnderlyingType) FCFuncElement("InternalGetCorElementType", ReflectionEnum::InternalGetCorElementType) @@ -82,12 +73,10 @@ FCFuncStart(gEnumFuncs) FCFuncElement("InternalHasFlag", ReflectionEnum::InternalHasFlag) FCFuncEnd() - FCFuncStart(gSymWrapperCodePunkSafeHandleFuncs) FCFuncElement("nGetDReleaseTarget", COMPunkSafeHandle::nGetDReleaseTarget) FCFuncEnd() - FCFuncStart(gObjectFuncs) FCIntrinsic("GetType", ObjectNative::GetClass, CORINFO_INTRINSIC_Object_GetType) FCFuncEnd() @@ -328,7 +317,6 @@ FCFuncStart(gRuntimeMethodHandle) FCFuncElement("GetLoaderAllocator", RuntimeMethodHandle::GetLoaderAllocator) FCFuncEnd() - FCFuncStart(gCOMFieldHandleNewFuncs) FCFuncElement("GetValue", RuntimeFieldHandle::GetValue) FCFuncElement("SetValue", RuntimeFieldHandle::SetValue) @@ -344,7 +332,6 @@ FCFuncStart(gCOMFieldHandleNewFuncs) FCFuncElement("AcquiresContextFromThis", RuntimeFieldHandle::AcquiresContextFromThis) FCFuncEnd() - FCFuncStart(gCOMModuleFuncs) QCFuncElement("GetType", COMModule::GetType) QCFuncElement("GetScopeName", COMModule::GetScopeName) @@ -530,65 +517,65 @@ FCFuncStart(gDelegateFuncs) FCFuncEnd() FCFuncStart(gMathFuncs) - FCFuncElementSig("Abs", &gsig_SM_Dbl_RetDbl, COMDouble::Abs) - FCFuncElementSig("Abs", &gsig_SM_Flt_RetFlt, COMSingle::Abs) - FCFuncElement("Acos", COMDouble::Acos) - FCFuncElement("Acosh", COMDouble::Acosh) - FCFuncElement("Asin", COMDouble::Asin) - FCFuncElement("Asinh", COMDouble::Asinh) - FCFuncElement("Atan", COMDouble::Atan) - FCFuncElement("Atanh", COMDouble::Atanh) - FCFuncElement("Atan2", COMDouble::Atan2) - FCFuncElement("Cbrt", COMDouble::Cbrt) - FCFuncElement("Ceiling", COMDouble::Ceil) - FCFuncElement("Cos", COMDouble::Cos) - FCFuncElement("Cosh", COMDouble::Cosh) - FCFuncElement("Exp", COMDouble::Exp) - FCFuncElement("Floor", COMDouble::Floor) - FCFuncElement("FMod", COMDouble::FMod) - FCFuncElement("FusedMultiplyAdd", COMDouble::FusedMultiplyAdd) - FCFuncElement("ILogB", COMDouble::ILogB) - FCFuncElement("Log", COMDouble::Log) - FCFuncElement("Log2", COMDouble::Log2) - FCFuncElement("Log10", COMDouble::Log10) - FCFuncElement("ModF", COMDouble::ModF) - FCFuncElement("Pow", COMDouble::Pow) - FCFuncElement("ScaleB", COMDouble::ScaleB) - FCFuncElement("Sin", COMDouble::Sin) - FCFuncElement("Sinh", COMDouble::Sinh) - FCFuncElement("Sqrt", COMDouble::Sqrt) - FCFuncElement("Tan", COMDouble::Tan) - FCFuncElement("Tanh", COMDouble::Tanh) + QCFuncElement("Abs", fabs) + QCFuncElement("AbsF", fabsf) + QCFuncElement("Acos", acos) + QCFuncElement("Acosh", acosh) + QCFuncElement("Asin", asin) + QCFuncElement("Asinh", asinh) + QCFuncElement("Atan", atan) + QCFuncElement("Atanh", atanh) + QCFuncElement("Atan2", atan2) + QCFuncElement("Cbrt", cbrt) + QCFuncElement("Ceiling", ceil) + QCFuncElement("Cos", cos) + QCFuncElement("Cosh", cosh) + QCFuncElement("Exp", exp) + QCFuncElement("Floor", floor) + QCFuncElement("FMod", fmod) + QCFuncElement("FusedMultiplyAdd", fma) + QCFuncElement("ILogB", ilogb) + QCFuncElement("Log", log) + QCFuncElement("Log2", log2) + QCFuncElement("Log10", log10) + QCFuncElement("ModF", modf) + QCFuncElement("Pow", pow) + QCFuncElement("ScaleB", scalbn) + QCFuncElement("Sin", sin) + QCFuncElement("Sinh", sinh) + QCFuncElement("Sqrt", sqrt) + QCFuncElement("Tan", tan) + QCFuncElement("Tanh", tanh) FCFuncEnd() FCFuncStart(gMathFFuncs) - FCFuncElement("Acos", COMSingle::Acos) - FCFuncElement("Acosh", COMSingle::Acosh) - FCFuncElement("Asin", COMSingle::Asin) - FCFuncElement("Asinh", COMSingle::Asinh) - FCFuncElement("Atan", COMSingle::Atan) - FCFuncElement("Atanh", COMSingle::Atanh) - FCFuncElement("Atan2", COMSingle::Atan2) - FCFuncElement("Cbrt", COMSingle::Cbrt) - FCFuncElement("Ceiling", COMSingle::Ceil) - FCFuncElement("Cos", COMSingle::Cos) - FCFuncElement("Cosh", COMSingle::Cosh) - FCFuncElement("Exp", COMSingle::Exp) - FCFuncElement("Floor", COMSingle::Floor) - FCFuncElement("FMod", COMSingle::FMod) - FCFuncElement("FusedMultiplyAdd", COMSingle::FusedMultiplyAdd) - FCFuncElement("ILogB", COMSingle::ILogB) - FCFuncElement("Log", COMSingle::Log) - FCFuncElement("Log2", COMSingle::Log2) - FCFuncElement("Log10", COMSingle::Log10) - FCFuncElement("ModF", COMSingle::ModF) - FCFuncElement("Pow", COMSingle::Pow) - FCFuncElement("ScaleB", COMSingle::ScaleB) - FCFuncElement("Sin", COMSingle::Sin) - FCFuncElement("Sinh", COMSingle::Sinh) - FCFuncElement("Sqrt", COMSingle::Sqrt) - FCFuncElement("Tan", COMSingle::Tan) - FCFuncElement("Tanh", COMSingle::Tanh) + QCFuncElement("Acos", acosf) + QCFuncElement("Acosh", acoshf) + QCFuncElement("Asin", asinf) + QCFuncElement("Asinh", asinhf) + QCFuncElement("Atan", atanf) + QCFuncElement("Atanh", atanhf) + QCFuncElement("Atan2", atan2f) + QCFuncElement("Cbrt", cbrtf) + QCFuncElement("Ceiling", ceilf) + QCFuncElement("Cos", cosf) + QCFuncElement("Cosh", coshf) + QCFuncElement("Exp", expf) + QCFuncElement("Floor", floorf) + QCFuncElement("FMod", fmodf) + QCFuncElement("FusedMultiplyAdd", fmaf) + QCFuncElement("ILogB", ilogbf) + QCFuncElement("Log", logf) + QCFuncElement("Log2", log2f) + QCFuncElement("Log10", log10f) + QCFuncElement("ModF", modff) + QCFuncElement("Pow", powf) + QCFuncElement("ScaleB", scalbnf) + QCFuncElement("Sin", sinf) + QCFuncElement("Sinh", sinhf) + QCFuncElement("Sqrt", sqrtf) + QCFuncElement("Tan", tanf) + QCFuncElement("Tanh", tanhf) FCFuncEnd() FCFuncStart(gThreadFuncs)