Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/design/coreclr/botr/readytorun-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@

#include <minipal/guid.h>

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
2 changes: 0 additions & 2 deletions src/coreclr/inc/jithelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 5 additions & 9 deletions src/coreclr/inc/readytorun.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
{
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/inc/readytorunhelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, )
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/jit/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 0 additions & 12 deletions src/coreclr/jit/valuenum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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:
Expand Down
23 changes: 0 additions & 23 deletions src/coreclr/nativeaot/Runtime/MathHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
30 changes: 0 additions & 30 deletions src/coreclr/vm/jithelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Loading