diff --git a/docs/design/coreclr/botr/readytorun-format.md b/docs/design/coreclr/botr/readytorun-format.md index 82cade6222ceab..ad20be6b17eaf8 100644 --- a/docs/design/coreclr/botr/readytorun-format.md +++ b/docs/design/coreclr/botr/readytorun-format.md @@ -862,11 +862,11 @@ enum ReadyToRunHelper READYTORUN_HELPER_UMod = 0xCF, // Floating point conversions - READYTORUN_HELPER_Dbl2Int = 0xD0, + READYTORUN_HELPER_Dbl2Int = 0xD0, // Unused since READYTORUN_MAJOR_VERSION 15.0 READYTORUN_HELPER_Dbl2IntOvf = 0xD1, READYTORUN_HELPER_Dbl2Lng = 0xD2, READYTORUN_HELPER_Dbl2LngOvf = 0xD3, - READYTORUN_HELPER_Dbl2UInt = 0xD4, + READYTORUN_HELPER_Dbl2UInt = 0xD4, // Unused since READYTORUN_MAJOR_VERSION 15.0 READYTORUN_HELPER_Dbl2UIntOvf = 0xD5, READYTORUN_HELPER_Dbl2ULng = 0xD6, READYTORUN_HELPER_Dbl2ULngOvf = 0xD7, diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index b3ed7004bd27fb..2309db3383ecc3 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -340,11 +340,9 @@ enum CorInfoHelpFunc CORINFO_HELP_LNG2DBL, // Convert a signed int64 to a double CORINFO_HELP_ULNG2FLT, // Convert a unsigned int64 to a float CORINFO_HELP_ULNG2DBL, // Convert a unsigned int64 to a double - CORINFO_HELP_DBL2INT, CORINFO_HELP_DBL2INT_OVF, CORINFO_HELP_DBL2LNG, CORINFO_HELP_DBL2LNG_OVF, - CORINFO_HELP_DBL2UINT, CORINFO_HELP_DBL2UINT_OVF, CORINFO_HELP_DBL2ULNG, CORINFO_HELP_DBL2ULNG_OVF, diff --git a/src/coreclr/inc/jiteeversionguid.h b/src/coreclr/inc/jiteeversionguid.h index 413ed397969811..736504aa9d126a 100644 --- a/src/coreclr/inc/jiteeversionguid.h +++ b/src/coreclr/inc/jiteeversionguid.h @@ -37,11 +37,11 @@ #include -constexpr GUID JITEEVersionIdentifier = { /* 7a77e6d9-7280-439d-bb9d-9887b4516a86 */ - 0x7a77e6d9, - 0x7280, - 0x439d, - {0xbb, 0x9d, 0x98, 0x87, 0xb4, 0x51, 0x6a, 0x86} +constexpr GUID JITEEVersionIdentifier = { /* ecc9bc7e-9223-4af6-af2f-b63e89c09279 */ + 0xecc9bc7e, + 0x9223, + 0x4af6, + {0xaf, 0x2f, 0xb6, 0x3e, 0x89, 0xc0, 0x92, 0x79} }; #endif // JIT_EE_VERSIONING_GUID_H diff --git a/src/coreclr/inc/jithelpers.h b/src/coreclr/inc/jithelpers.h index c5ab2cff134fa0..88396948b9bb3c 100644 --- a/src/coreclr/inc/jithelpers.h +++ b/src/coreclr/inc/jithelpers.h @@ -87,11 +87,9 @@ JITHELPER(CORINFO_HELP_LNG2DBL, JIT_Lng2Dbl, METHOD__NIL) JITHELPER(CORINFO_HELP_ULNG2FLT, JIT_ULng2Flt, METHOD__NIL) JITHELPER(CORINFO_HELP_ULNG2DBL, JIT_ULng2Dbl, METHOD__NIL) - JITHELPER(CORINFO_HELP_DBL2INT, JIT_Dbl2Int, METHOD__NIL) DYNAMICJITHELPER(CORINFO_HELP_DBL2INT_OVF, NULL, METHOD__MATH__CONVERT_TO_INT32_CHECKED) JITHELPER(CORINFO_HELP_DBL2LNG, JIT_Dbl2Lng, METHOD__NIL) DYNAMICJITHELPER(CORINFO_HELP_DBL2LNG_OVF, NULL, METHOD__MATH__CONVERT_TO_INT64_CHECKED) - JITHELPER(CORINFO_HELP_DBL2UINT, JIT_Dbl2UInt, METHOD__NIL) DYNAMICJITHELPER(CORINFO_HELP_DBL2UINT_OVF, NULL, METHOD__MATH__CONVERT_TO_UINT32_CHECKED) JITHELPER(CORINFO_HELP_DBL2ULNG, JIT_Dbl2ULng, METHOD__NIL) DYNAMICJITHELPER(CORINFO_HELP_DBL2ULNG_OVF, NULL, METHOD__MATH__CONVERT_TO_UINT64_CHECKED) diff --git a/src/coreclr/inc/readytorun.h b/src/coreclr/inc/readytorun.h index a9a0fba017b0ba..e5fbd43815dab4 100644 --- a/src/coreclr/inc/readytorun.h +++ b/src/coreclr/inc/readytorun.h @@ -19,15 +19,10 @@ // src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h // If you update this, ensure you run `git grep MINIMUM_READYTORUN_MAJOR_VERSION` // and handle pending work. -#define READYTORUN_MAJOR_VERSION 14 +#define READYTORUN_MAJOR_VERSION 15 #define READYTORUN_MINOR_VERSION 0x0000 -// Remove the x86 special case once the general minimum version is bumped -#ifdef TARGET_X86 -#define MINIMUM_READYTORUN_MAJOR_VERSION 14 -#else -#define MINIMUM_READYTORUN_MAJOR_VERSION 13 -#endif +#define MINIMUM_READYTORUN_MAJOR_VERSION 15 // R2R Version 2.1 adds the InliningInfo section // R2R Version 2.2 adds the ProfileDataInfo section @@ -50,6 +45,7 @@ // to be SP/FP relative // R2R Version 13.1 added long/ulong to float helper calls // R2R Version 14 changed x86 code generation to use funclets +// R2R Version 15 removes double to int/uint helper calls struct READYTORUN_CORE_HEADER { @@ -410,11 +406,11 @@ enum ReadyToRunHelper READYTORUN_HELPER_UMod = 0xCF, // Floating point conversions - READYTORUN_HELPER_Dbl2Int = 0xD0, + READYTORUN_HELPER_Dbl2Int = 0xD0, // Unused since READYTORUN_MAJOR_VERSION 15.0 READYTORUN_HELPER_Dbl2IntOvf = 0xD1, READYTORUN_HELPER_Dbl2Lng = 0xD2, READYTORUN_HELPER_Dbl2LngOvf = 0xD3, - READYTORUN_HELPER_Dbl2UInt = 0xD4, + READYTORUN_HELPER_Dbl2UInt = 0xD4, // Unused since READYTORUN_MAJOR_VERSION 15.0 READYTORUN_HELPER_Dbl2UIntOvf = 0xD5, READYTORUN_HELPER_Dbl2ULng = 0xD6, READYTORUN_HELPER_Dbl2ULngOvf = 0xD7, diff --git a/src/coreclr/inc/readytorunhelpers.h b/src/coreclr/inc/readytorunhelpers.h index 50cd622b948baa..c6e1a09ca5eb87 100644 --- a/src/coreclr/inc/readytorunhelpers.h +++ b/src/coreclr/inc/readytorunhelpers.h @@ -78,11 +78,9 @@ HELPER(READYTORUN_HELPER_Mod, CORINFO_HELP_MOD, HELPER(READYTORUN_HELPER_UDiv, CORINFO_HELP_UDIV, ) HELPER(READYTORUN_HELPER_UMod, CORINFO_HELP_UMOD, ) -HELPER(READYTORUN_HELPER_Dbl2Int, CORINFO_HELP_DBL2INT, ) HELPER(READYTORUN_HELPER_Dbl2IntOvf, CORINFO_HELP_DBL2INT_OVF, ) HELPER(READYTORUN_HELPER_Dbl2Lng, CORINFO_HELP_DBL2LNG, ) HELPER(READYTORUN_HELPER_Dbl2LngOvf, CORINFO_HELP_DBL2LNG_OVF, ) -HELPER(READYTORUN_HELPER_Dbl2UInt, CORINFO_HELP_DBL2UINT, ) HELPER(READYTORUN_HELPER_Dbl2UIntOvf, CORINFO_HELP_DBL2UINT_OVF, ) HELPER(READYTORUN_HELPER_Dbl2ULng, CORINFO_HELP_DBL2ULNG, ) HELPER(READYTORUN_HELPER_Dbl2ULngOvf, CORINFO_HELP_DBL2ULNG_OVF, ) diff --git a/src/coreclr/jit/utils.cpp b/src/coreclr/jit/utils.cpp index dc009c2450a3b7..c28ba5b2decaa7 100644 --- a/src/coreclr/jit/utils.cpp +++ b/src/coreclr/jit/utils.cpp @@ -1534,9 +1534,7 @@ void HelperCallProperties::init() case CORINFO_HELP_LNG2DBL: case CORINFO_HELP_ULNG2FLT: case CORINFO_HELP_ULNG2DBL: - case CORINFO_HELP_DBL2INT: case CORINFO_HELP_DBL2LNG: - case CORINFO_HELP_DBL2UINT: case CORINFO_HELP_DBL2ULNG: case CORINFO_HELP_FLTREM: case CORINFO_HELP_DBLREM: diff --git a/src/coreclr/jit/valuenum.cpp b/src/coreclr/jit/valuenum.cpp index 753e7a1fb82158..d1ea9ee955e5f3 100644 --- a/src/coreclr/jit/valuenum.cpp +++ b/src/coreclr/jit/valuenum.cpp @@ -13939,11 +13939,6 @@ void Compiler::fgValueNumberCastHelper(GenTreeCall* call) srcIsUnsigned = true; break; - case CORINFO_HELP_DBL2INT: - castToType = TYP_INT; - castFromType = TYP_DOUBLE; - break; - case CORINFO_HELP_DBL2INT_OVF: castToType = TYP_INT; castFromType = TYP_DOUBLE; @@ -13961,11 +13956,6 @@ void Compiler::fgValueNumberCastHelper(GenTreeCall* call) hasOverflowCheck = true; break; - case CORINFO_HELP_DBL2UINT: - castToType = TYP_UINT; - castFromType = TYP_DOUBLE; - break; - case CORINFO_HELP_DBL2UINT_OVF: castToType = TYP_UINT; castFromType = TYP_DOUBLE; @@ -14284,11 +14274,9 @@ bool Compiler::fgValueNumberHelperCall(GenTreeCall* call) case CORINFO_HELP_LNG2DBL: case CORINFO_HELP_ULNG2FLT: case CORINFO_HELP_ULNG2DBL: - case CORINFO_HELP_DBL2INT: case CORINFO_HELP_DBL2INT_OVF: case CORINFO_HELP_DBL2LNG: case CORINFO_HELP_DBL2LNG_OVF: - case CORINFO_HELP_DBL2UINT: case CORINFO_HELP_DBL2UINT_OVF: case CORINFO_HELP_DBL2ULNG: case CORINFO_HELP_DBL2ULNG_OVF: diff --git a/src/coreclr/nativeaot/Runtime/MathHelpers.cpp b/src/coreclr/nativeaot/Runtime/MathHelpers.cpp index 033edb3de28d6e..2cd1075b047502 100644 --- a/src/coreclr/nativeaot/Runtime/MathHelpers.cpp +++ b/src/coreclr/nativeaot/Runtime/MathHelpers.cpp @@ -32,29 +32,6 @@ FCIMPL1_D(int64_t, RhpDbl2Lng, double val) } FCIMPLEND -FCIMPL1_D(int32_t, RhpDbl2Int, double val) -{ -#if defined(HOST_X86) || defined(HOST_AMD64) - const double int32_min = -2147483648.0; - const double int32_max_plus_1 = 2147483648.0; - return (val != val) ? 0 : (val <= int32_min) ? INT32_MIN : (val >= int32_max_plus_1) ? INT32_MAX : (int32_t)val; -#else - return (int32_t)val; -#endif -} -FCIMPLEND - -FCIMPL1_D(uint32_t, RhpDbl2UInt, double val) -{ -#if defined(HOST_X86) || defined(HOST_AMD64) - const double uint_max = 4294967295.0; - return (val > 0) ? ((val >= uint_max) ? UINT32_MAX : (uint32_t)val) : 0; -#else - return (uint32_t)val; -#endif -} -FCIMPLEND - #ifndef HOST_64BIT FCIMPL2_LL(int64_t, DivInt64Internal, int64_t i, int64_t j) { diff --git a/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h b/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h index 2b7464aa4ea97c..b41d65af26f27c 100644 --- a/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h +++ b/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h @@ -11,7 +11,7 @@ struct ReadyToRunHeaderConstants { static const uint32_t Signature = 0x00525452; // 'RTR' - static const uint32_t CurrentMajorVersion = 14; + static const uint32_t CurrentMajorVersion = 15; static const uint32_t CurrentMinorVersion = 0; }; diff --git a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs index e8fdf030893432..c624469449c421 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs @@ -15,7 +15,7 @@ internal struct ReadyToRunHeaderConstants { public const uint Signature = 0x00525452; // 'RTR' - public const ushort CurrentMajorVersion = 14; + public const ushort CurrentMajorVersion = 15; public const ushort CurrentMinorVersion = 0; } #if READYTORUN diff --git a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs index 43f7586507fbff..623422b7aef992 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs @@ -304,11 +304,11 @@ public enum ReadyToRunHelper UMod = 0xCF, // Floating point conversions - Dbl2Int = 0xD0, + Dbl2Int = 0xD0, // Unused since READYTORUN_MAJOR_VERSION 15.0 Dbl2IntOvf = 0xD1, Dbl2Lng = 0xD2, Dbl2LngOvf = 0xD3, - Dbl2UInt = 0xD4, + Dbl2UInt = 0xD4, // Unused since READYTORUN_MAJOR_VERSION 15.0 Dbl2UIntOvf = 0xD5, Dbl2ULng = 0xD6, Dbl2ULngOvf = 0xD7, diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs b/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs index 7bd9cdaf576627..2a8e08fe327cd0 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs @@ -32,11 +32,9 @@ public enum CorInfoHelpFunc CORINFO_HELP_LNG2DBL, // Convert a signed int64 to a double CORINFO_HELP_ULNG2FLT, // Convert a unsigned int64 to a float CORINFO_HELP_ULNG2DBL, // Convert a unsigned int64 to a double - CORINFO_HELP_DBL2INT, CORINFO_HELP_DBL2INT_OVF, CORINFO_HELP_DBL2LNG, CORINFO_HELP_DBL2LNG_OVF, - CORINFO_HELP_DBL2UINT, CORINFO_HELP_DBL2UINT_OVF, CORINFO_HELP_DBL2ULNG, CORINFO_HELP_DBL2ULNG_OVF, diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/JitHelper.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/JitHelper.cs index 5c58b09a0302af..62dc89ddaed302 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/JitHelper.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/JitHelper.cs @@ -195,12 +195,6 @@ public static void GetEntryPoint(TypeSystemContext context, ReadyToRunHelper id, case ReadyToRunHelper.Dbl2ULng: mangledName = "RhpDbl2ULng"; break; - case ReadyToRunHelper.Dbl2Int: - mangledName = "RhpDbl2Int"; - break; - case ReadyToRunHelper.Dbl2UInt: - mangledName = "RhpDbl2UInt"; - break; case ReadyToRunHelper.Dbl2IntOvf: methodDesc = context.SystemModule.GetKnownType("System", "Math").GetKnownMethod("ConvertToInt32Checked", null); diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs index c39971017ce7ec..3e3c1762f1823e 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs @@ -1148,9 +1148,6 @@ private ISymbolNode GetHelperFtnUncached(CorInfoHelpFunc ftnNum) id = ReadyToRunHelper.UMod; break; - case CorInfoHelpFunc.CORINFO_HELP_DBL2INT: - id = ReadyToRunHelper.Dbl2Int; - break; case CorInfoHelpFunc.CORINFO_HELP_DBL2INT_OVF: id = ReadyToRunHelper.Dbl2IntOvf; break; @@ -1160,9 +1157,6 @@ private ISymbolNode GetHelperFtnUncached(CorInfoHelpFunc ftnNum) case CorInfoHelpFunc.CORINFO_HELP_DBL2LNG_OVF: id = ReadyToRunHelper.Dbl2LngOvf; break; - case CorInfoHelpFunc.CORINFO_HELP_DBL2UINT: - id = ReadyToRunHelper.Dbl2UInt; - break; case CorInfoHelpFunc.CORINFO_HELP_DBL2UINT_OVF: id = ReadyToRunHelper.Dbl2UIntOvf; break; diff --git a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs index d8759785554945..6cf54e7854c1d5 100644 --- a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs +++ b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs @@ -1897,10 +1897,6 @@ private void ParseHelper(StringBuilder builder) break; // Floating point conversions - case ReadyToRunHelper.Dbl2Int: - builder.Append("DBL2INT"); - break; - case ReadyToRunHelper.Dbl2IntOvf: builder.Append("DBL2INTOVF"); break; @@ -1913,10 +1909,6 @@ private void ParseHelper(StringBuilder builder) builder.Append("DBL2LNGOVF"); break; - case ReadyToRunHelper.Dbl2UInt: - builder.Append("DBL2UINT"); - break; - case ReadyToRunHelper.Dbl2UIntOvf: builder.Append("DBL2UINTOVF"); break; diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs b/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs index 56018bacc542e2..c727d22513ade5 100644 --- a/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs +++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs @@ -677,9 +677,6 @@ private ISymbolNode GetHelperFtnUncached(CorInfoHelpFunc ftnNum) id = ReadyToRunHelper.UMod; break; - case CorInfoHelpFunc.CORINFO_HELP_DBL2INT: - id = ReadyToRunHelper.Dbl2Int; - break; case CorInfoHelpFunc.CORINFO_HELP_DBL2INT_OVF: id = ReadyToRunHelper.Dbl2IntOvf; break; @@ -689,9 +686,6 @@ private ISymbolNode GetHelperFtnUncached(CorInfoHelpFunc ftnNum) case CorInfoHelpFunc.CORINFO_HELP_DBL2LNG_OVF: id = ReadyToRunHelper.Dbl2LngOvf; break; - case CorInfoHelpFunc.CORINFO_HELP_DBL2UINT: - id = ReadyToRunHelper.Dbl2UInt; - break; case CorInfoHelpFunc.CORINFO_HELP_DBL2UINT_OVF: id = ReadyToRunHelper.Dbl2UIntOvf; break; diff --git a/src/coreclr/vm/jithelpers.cpp b/src/coreclr/vm/jithelpers.cpp index 598e68fcc4467e..0304325b12946b 100644 --- a/src/coreclr/vm/jithelpers.cpp +++ b/src/coreclr/vm/jithelpers.cpp @@ -211,36 +211,6 @@ HCIMPL1_V(int64_t, JIT_Dbl2Lng, double val) } HCIMPLEND -/*********************************************************************/ -HCIMPL1_V(uint32_t, JIT_Dbl2UInt, double val) -{ - FCALL_CONTRACT; - -#if defined(TARGET_X86) || defined(TARGET_AMD64) - const double uint_max = 4294967295.0; - // Note that this expression also works properly for val = NaN case - return (val >= 0) ? ((val >= uint_max) ? UINT32_MAX : (uint32_t)val) : 0; -#else - return (uint32_t)val; -#endif -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL1_V(int32_t, JIT_Dbl2Int, double val) -{ - FCALL_CONTRACT; - -#if defined(TARGET_X86) || defined(TARGET_AMD64) - const double int32_min = -2147483648.0; - const double int32_max_plus_1 = 2147483648.0; - return (val != val) ? 0 : (val <= int32_min) ? INT32_MIN : (val >= int32_max_plus_1) ? INT32_MAX : (int32_t)val; -#else - return (int32_t)val; -#endif -} -HCIMPLEND - /*********************************************************************/ HCIMPL1_V(uint64_t, JIT_Dbl2ULng, double val) {