New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add empty X64/Arm64 nested classes to some System.Runtime.Intrinsics #34587
Comments
Tagging @tannergooding as an area owner |
Ah, looks like the same problem exists for x64 as well, e.g.:
Prints So we need to do the same for: |
For x64 this is a possible breaking change if the user recompiles. I still think it provides a better experience, but it is something that needs to be considered. |
partial class Sha1 : ArmBase
{
[EditorBrowsable(Never)]
public abstract class Arm64
{
// No inheritance, no IsSupported
}
} |
I believe this needs to go back to API review. For x64 in particular, the above doesn't work as there are scenarios like: In this case, If we expose intermediate It is already the case that |
CC. @echesakovMSFT, @terrajobst |
[Intrinsic]
[CLSCompliant(false)]
public partial class Sha1 : ArmBase
{
public abstract class Arm64 : ArmBase.Arm64;
{
public static new bool IsSupported => Sha1.IsSupported && IntPtr.Size == 8;
}
} |
@tannergooding can we add a breaking change doc here? https://github.com/dotnet/docs/issues/new?template=dotnet-breaking-change.md |
Rationale
Imagine you have an arm64 CPU with
ArmBase
andArmBase.Arm64
support (both are always enabled for any arm64 CPU), but withoutAes
,Sha1
andSha256
features, let's run the following snippet:The problem here is the fact that
Aes
,Sha1
andSha256
inherit fromArmBase
but don't define their ownArm64
nested classes, see sharplab.io for more details (it explains why it can't be fixed in the jit).Proposed API
(same for
Sha256
andAes
)UPD same for
Aes
,Avx
,Avx2
,Fma
,Pclmulqdq
,Sse3
,Ssse3
/cc @tannergooding @echesakovMSFT
The text was updated successfully, but these errors were encountered: