Add JIT-helper of ArgTypeNotSupportedException#15028
Conversation
|
@CarolEidt @jkotas Would you like to port this change to desktop CLR at first? I need this jit-helper in my |
|
You will need to change JIT interface GUID at the top of corinfo..h for this change. cc @dotnet/jit-contrib |
| CORINFO_HELP_THROW_ARGUMENTEXCEPTION, // throw ArgumentException | ||
| CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, // throw ArgumentOutOfRangeException | ||
| CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED, // throw PlatformNotSupportedException | ||
| CORINFO_HELP_THROW_ARGTYPE_NOT_SUPPORTED, // throw NotSupportedException |
@jkotas I see. Shall I update GUID now? Or wait for the update from desktop CLR change? |
|
Go ahead and make the GUID change as part of your checkin. We will need to check in the |
|
@briansull Got it, thank you. |
|
@dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test |
|
@jkotas The test failures look unrelated to this change? |
|
Actually, I do not think you need a helper for this. Why can't the jit fallback to the non-inlined implementation to throw the exception? |
@jkotas Do you mean something like this? public static Vector128<T> GetLowerHalf<T>(Vector256<T> value) where T : struct
{
if (typeof(T) != typeof(Byte) && typeof(T) != typeof(UByte) && ... )
{
throw new NotSupportedException(SR.Arg_TypeNotSupported);
}
return GetLowerHalf<T>(value);
}This is a good point. However, our current contract is "named intrinsics that directly called by itself must be expanded". If we add the exception code in the managed implementation, that would break this contract. Then other named intrinsics cannot have the fallback with any recursive algorithm in the future. I am afraid that might be a too strict limitation. |
|
Right, something like this. I would think that |
I meant maybe other recursive intrinsics (in the future) that we still want them optionally expanded and only "directly recursive" intrinsics are forced expanded. |
|
Right, I do not think we need to worry about it - until we have a real situation like that. |
Intel hardware intrinsics need to throw exceptions with
System.NotSupportedException: Specified type is not supportedonVector128/256<T>that is instantiated by non-numeric types.