diff options
author | Tanner Gooding <tannergooding@users.noreply.github.com> | 2017-03-03 22:26:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-03 22:26:26 -0800 |
commit | da2cebba91a6a0454234c86299070d2696cef412 (patch) | |
tree | 5e33256c2f0d39dd3ca9536c06645ce5c2121d95 /src | |
parent | 6bf345c219690328bd839e7719af36dc98c2c9d6 (diff) | |
parent | 0af0491aacc1473218d4b2715c9fc180c9889483 (diff) | |
download | coreclr-da2cebba91a6a0454234c86299070d2696cef412.tar.gz coreclr-da2cebba91a6a0454234c86299070d2696cef412.tar.bz2 coreclr-da2cebba91a6a0454234c86299070d2696cef412.zip |
Merge pull request #9954 from tannergooding/fcall
Updating `COMSingle` in `classlibnative` to use the appropriate FCALL declarations.
Diffstat (limited to 'src')
-rw-r--r-- | src/classlibnative/float/floatsingle.cpp | 38 | ||||
-rw-r--r-- | src/classlibnative/inc/floatsingle.h | 38 | ||||
-rw-r--r-- | src/vm/fcall.h | 11 |
3 files changed, 45 insertions, 42 deletions
diff --git a/src/classlibnative/float/floatsingle.cpp b/src/classlibnative/float/floatsingle.cpp index 7e2ea0adc6..c84c0bfb93 100644 --- a/src/classlibnative/float/floatsingle.cpp +++ b/src/classlibnative/float/floatsingle.cpp @@ -49,7 +49,7 @@ /*=====================================Abs===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Abs, float x) +FCIMPL1_V(float, COMSingle::Abs, float x) FCALL_CONTRACT; return (float)fabsf(x); @@ -58,7 +58,7 @@ FCIMPLEND /*=====================================Acos===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Acos, float x) +FCIMPL1_V(float, COMSingle::Acos, float x) FCALL_CONTRACT; return (float)acosf(x); @@ -67,7 +67,7 @@ FCIMPLEND /*=====================================Asin===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Asin, float x) +FCIMPL1_V(float, COMSingle::Asin, float x) FCALL_CONTRACT; return (float)asinf(x); @@ -76,7 +76,7 @@ FCIMPLEND /*=====================================Atan===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Atan, float x) +FCIMPL1_V(float, COMSingle::Atan, float x) FCALL_CONTRACT; return (float)atanf(x); @@ -85,7 +85,7 @@ FCIMPLEND /*=====================================Atan2==================================== ** ==============================================================================*/ -FCIMPL2(float, COMSingle::Atan2, float y, float x) +FCIMPL2_VV(float, COMSingle::Atan2, float y, float x) FCALL_CONTRACT; // atan2f(+/-INFINITY, +/-INFINITY) produces +/-0.785398163f (x is +INFINITY) and @@ -101,7 +101,7 @@ FCIMPLEND /*====================================Ceil====================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Ceil, float x) +FCIMPL1_V(float, COMSingle::Ceil, float x) FCALL_CONTRACT; return (float)ceilf(x); @@ -110,7 +110,7 @@ FCIMPLEND /*=====================================Cos====================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Cos, float x) +FCIMPL1_V(float, COMSingle::Cos, float x) FCALL_CONTRACT; return (float)cosf(x); @@ -119,7 +119,7 @@ FCIMPLEND /*=====================================Cosh===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Cosh, float x) +FCIMPL1_V(float, COMSingle::Cosh, float x) FCALL_CONTRACT; return (float)coshf(x); @@ -128,7 +128,7 @@ FCIMPLEND /*=====================================Exp====================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Exp, float x) +FCIMPL1_V(float, COMSingle::Exp, float x) FCALL_CONTRACT; return (float)expf(x); @@ -137,7 +137,7 @@ FCIMPLEND /*====================================Floor===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Floor, float x) +FCIMPL1_V(float, COMSingle::Floor, float x) FCALL_CONTRACT; return (float)floorf(x); @@ -146,7 +146,7 @@ FCIMPLEND /*=====================================Log====================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Log, float x) +FCIMPL1_V(float, COMSingle::Log, float x) FCALL_CONTRACT; return (float)logf(x); @@ -155,7 +155,7 @@ FCIMPLEND /*====================================Log10===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Log10, float x) +FCIMPL1_V(float, COMSingle::Log10, float x) FCALL_CONTRACT; return (float)log10f(x); @@ -173,7 +173,7 @@ FCIMPLEND /*=====================================Pow====================================== ** ==============================================================================*/ -FCIMPL2(float, COMSingle::Pow, float x, float y) +FCIMPL2_VV(float, COMSingle::Pow, float x, float y) FCALL_CONTRACT; // The CRT version of pow preserves the NaN payload of x over the NaN payload of y. @@ -200,7 +200,7 @@ FCIMPLEND /*====================================Round===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Round, float x) +FCIMPL1_V(float, COMSingle::Round, float x) FCALL_CONTRACT; // If the number has no fractional part do nothing @@ -225,7 +225,7 @@ FCIMPLEND /*=====================================Sin====================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Sin, float x) +FCIMPL1_V(float, COMSingle::Sin, float x) FCALL_CONTRACT; return (float)sinf(x); @@ -234,7 +234,7 @@ FCIMPLEND /*=====================================Sinh===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Sinh, float x) +FCIMPL1_V(float, COMSingle::Sinh, float x) FCALL_CONTRACT; return (float)sinhf(x); @@ -243,7 +243,7 @@ FCIMPLEND /*=====================================Sqrt===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Sqrt, float x) +FCIMPL1_V(float, COMSingle::Sqrt, float x) FCALL_CONTRACT; return (float)sqrtf(x); @@ -252,7 +252,7 @@ FCIMPLEND /*=====================================Tan====================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Tan, float x) +FCIMPL1_V(float, COMSingle::Tan, float x) FCALL_CONTRACT; return (float)tanf(x); @@ -261,7 +261,7 @@ FCIMPLEND /*=====================================Tanh===================================== ** ==============================================================================*/ -FCIMPL1(float, COMSingle::Tanh, float x) +FCIMPL1_V(float, COMSingle::Tanh, float x) FCALL_CONTRACT; return (float)tanhf(x); diff --git a/src/classlibnative/inc/floatsingle.h b/src/classlibnative/inc/floatsingle.h index f8a1dda0fd..8296e2d37a 100644 --- a/src/classlibnative/inc/floatsingle.h +++ b/src/classlibnative/inc/floatsingle.h @@ -10,26 +10,26 @@ class COMSingle { public: - FCDECL1(static float, Abs, float x); - FCDECL1(static float, Acos, float x); - FCDECL1(static float, Asin, float x); - FCDECL1(static float, Atan, float x); - FCDECL2(static float, Atan2, float y, float x); - FCDECL1(static float, Ceil, float x); - FCDECL1(static float, Cos, float x); - FCDECL1(static float, Cosh, float x); - FCDECL1(static float, Exp, float x); - FCDECL1(static float, Floor, float x); - FCDECL1(static float, Log, float x); - FCDECL1(static float, Log10, float x); + FCDECL1_V(static float, Abs, float x); + FCDECL1_V(static float, Acos, float x); + FCDECL1_V(static float, Asin, float x); + FCDECL1_V(static float, Atan, float x); + FCDECL2_VV(static float, Atan2, float y, 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); + FCDECL1_V(static float, Log, float x); + FCDECL1_V(static float, Log10, float x); FCDECL1(static float, ModF, float* iptr); - FCDECL2(static float, Pow, float x, float y); - FCDECL1(static float, Round, float x); - FCDECL1(static float, Sin, float x); - FCDECL1(static float, Sinh, float x); - FCDECL1(static float, Sqrt, float x); - FCDECL1(static float, Tan, float x); - FCDECL1(static float, Tanh, float x); + FCDECL2_VV(static float, Pow, float x, float y); + FCDECL1_V(static float, Round, float x); + 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/vm/fcall.h b/src/vm/fcall.h index a952da1294..988aa3df74 100644 --- a/src/vm/fcall.h +++ b/src/vm/fcall.h @@ -138,10 +138,13 @@ // FCThrow(). This is because FCThrow() has to generate an unexecuted // "return" statement for the code parser. // -// - If first and/or second argument of your FCall is 64-bit value on x86 -// (ie INT64, UINT64 or DOUBLE), you must use "V" versions of FCDECL and -// FCIMPL macros to enregister arguments correctly. For example, FCDECL3_IVI -// must be used for FCalls that take 3 arguments and 2nd argument is INT64. +// - On x86, if first and/or second argument of your FCall cannot be passed +// in either of the __fastcall registers (ECX/EDX), you must use "V" versions +// of FCDECL and FCIMPL macros to enregister arguments correctly. Some of the +// most common types that fit this requirement are 64-bit values (i.e. INT64 or +// UINT64) and floating-point values (i.e. FLOAT or DOUBLE). For example, FCDECL3_IVI +// must be used for FCalls that take 3 arguments and 2nd argument is INT64 and +// FDECL2_VV must be used for FCalls that take 2 arguments where both are FLOAT. // // - You may use structs for protecting multiple OBJECTREF's simultaneously. // In these cases, you must use a variant of a helper method frame with PROTECT |