Skip to content

Commit ddb2b8f

Browse files
committed
Fixup coreclr checks too
1 parent 1e7db5b commit ddb2b8f

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4421,29 +4421,44 @@ private bool notifyInstructionSetUsage(InstructionSet instructionSet, bool suppo
44214421
}
44224422
else
44234423
{
4424+
// We want explicitly implemented ISimdVector<TSelf, T> APIs to still be expanded where possible
4425+
// but, they all prefix the qualified name of the interface first, so we'll check for that and
4426+
// skip the prefix before trying to resolve the method.
44244427
ReadOnlySpan<char> methodName = MethodBeingCompiled.Name.AsSpan();
44254428

4426-
if (methodName.StartsWith("System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector"))
4429+
if (methodName.StartsWith("System.Runtime.Intrinsics.ISimdVector<System."))
44274430
{
4428-
// We want explicitly implemented ISimdVector<TSelf, T> APIs to still be expanded where possible
4429-
// but, they all prefix the qualified name of the interface first, so we'll check for that and
4430-
// skip the prefix before trying to resolve the method.
4431+
ReadOnlySpan<char> partialMethodName = methodName.Slice(45);
44314432

4432-
ReadOnlySpan<char> partialMethodName = methodName.Slice(70);
4433-
4434-
if (partialMethodName.StartsWith("<T>,T>."))
4435-
{
4436-
methodName = partialMethodName.Slice(7);
4437-
}
4438-
else if (partialMethodName.StartsWith("64<T>,T>."))
4433+
if (partialMethodName.StartWith("Numerics.Vector"))
44394434
{
4440-
methodName = partialMethodName.Slice(9);
4435+
partialMethodName = partialMethodName.Slice(15);
4436+
4437+
if (partialMethodName.StartsWith("<T>,T>."))
4438+
{
4439+
methodName = partialMethodName.Slice(7);
4440+
}
44414441
}
4442-
else if (partialMethodName.StartsWith("128<T>,T>.") ||
4443-
partialMethodName.StartsWith("256<T>,T>.") ||
4444-
partialMethodName.StartsWith("512<T>,T>."))
4442+
if (partialMethodName.StartWith("Runtime.Intrinsics.Vector"))
44454443
{
4446-
methodName = partialMethodName.Slice(10);
4444+
partialMethodName = partialMethodName.Slice(25);
4445+
4446+
if (partialMethodName.StartsWith("128<T>,T>.") ||
4447+
partialMethodName.StartsWith("256<T>,T>.") ||
4448+
partialMethodName.StartsWith("512<T>,T>."))
4449+
{
4450+
methodName = partialMethodName.Slice(8);
4451+
}
4452+
else if (partialMethodName.StartsWith("64<T>,T>."))
4453+
{
4454+
methodName = partialMethodName.Slice(9);
4455+
}
4456+
else if (partialMethodName.StartsWith("128<T>,T>.") ||
4457+
partialMethodName.StartsWith("256<T>,T>.") ||
4458+
partialMethodName.StartsWith("512<T>,T>."))
4459+
{
4460+
methodName = partialMethodName.Slice(10);
4461+
}
44474462
}
44484463
}
44494464

0 commit comments

Comments
 (0)