diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs index c13f7e8132ed22..0b0e92e9577200 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs @@ -1338,6 +1338,13 @@ public static unsafe bool Invert(Matrix4x4 matrix, out Matrix4x4 result) static unsafe bool SseImpl(Matrix4x4 matrix, out Matrix4x4 result) { + // Redundant test so we won't prejit remainder of this method + // on platforms without SSE. + if (!Sse.IsSupported) + { + throw new PlatformNotSupportedException(); + } + // This implementation is based on the DirectX Math Library XMMInverse method // https://github.com/microsoft/DirectXMath/blob/master/Inc/DirectXMathMatrix.inl