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
2 changes: 1 addition & 1 deletion src/coreclr/jit/instr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const char* CodeGen::genInsDisplayName(emitter::instrDesc* id)

auto GetIntCmpOpName = [&](const char* suffix) -> const char* {
static const char* const intCmpOpNames[] = {
"eq", "lt", "le", "neq", "false", "ge", "gt", "true",
"eq", "lt", "le", "false", "neq", "ge", "gt", "true",
};

uint8_t control = static_cast<uint8_t>(emit->emitGetInsSC(id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;

using Internal.Text;
using Internal.TypeSystem;

using Debug = System.Diagnostics.Debug;
Expand Down Expand Up @@ -56,9 +57,7 @@ public static MethodIL EmitIL(MethodDesc method)
result = false;
if (elementType is MetadataType mdType)
{
if (mdType.Module == mdType.Context.SystemModule &&
mdType.Namespace == "System.Text"u8 &&
mdType.Name == "Rune"u8)
if (IsKnownBitwiseEquatableType(mdType))
{
result = true;
}
Expand Down Expand Up @@ -88,5 +87,21 @@ public static MethodIL EmitIL(MethodDesc method)

return new ILStubMethodIL(method, new byte[] { (byte)opcode, (byte)ILOpcode.ret }, Array.Empty<LocalVariableDefinition>(), Array.Empty<object>());
}

private static bool IsKnownBitwiseEquatableType(MetadataType type)
{
if (type.Module != type.Context.SystemModule)
{
return false;
}

Utf8Span ns = type.Namespace;
if (ns == "System"u8)
{
Utf8Span name = type.Name;
return name == "Guid"u8 || name == "Int128"u8 || name == "UInt128"u8;
}
return ns == "System.Text"u8 && type.Name == "Rune"u8;
}
}
}
3 changes: 3 additions & 0 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7347,8 +7347,11 @@ static bool getILIntrinsicImplementationForRuntimeHelpers(
|| methodTable == CoreLibBinder::GetClass(CLASS__UINT32)
|| methodTable == CoreLibBinder::GetClass(CLASS__INT64)
|| methodTable == CoreLibBinder::GetClass(CLASS__UINT64)
|| methodTable == CoreLibBinder::GetClass(CLASS__INT128)
Comment thread
EgorBo marked this conversation as resolved.
|| methodTable == CoreLibBinder::GetClass(CLASS__UINT128)
|| methodTable == CoreLibBinder::GetClass(CLASS__INTPTR)
|| methodTable == CoreLibBinder::GetClass(CLASS__UINTPTR)
|| methodTable == CoreLibBinder::GetClass(CLASS__GUID)
Comment thread
EgorBo marked this conversation as resolved.
Comment thread
EgorBo marked this conversation as resolved.
|| methodTable == CoreLibBinder::GetClass(CLASS__RUNE)
Comment thread
EgorBo marked this conversation as resolved.
|| methodTable->IsEnum()
|| IsBitwiseEquatable(typeHandle, methodTable))
Expand Down
Loading