-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[API Implementation]: Support for Intel SHA extensions #62999
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics Issue DetailsProposal implementation of #256 (closes #256) Proposalnamespace System.Runtime.Intrinsics.X86
{
public class Sha1
{
public static bool IsSupported { get; }
public static Vector128<byte> MessageSchedule1(Vector128<byte> a, Vector128<byte> b);
public static Vector128<byte> MessageSchedule2(Vector128<byte> a, Vector128<byte> b);
public static Vector128<byte> NextE(Vector128<byte> a, Vector128<byte> b);
public static Vector128<byte> FourRounds(Vector128<byte> a, Vector128<byte> b, byte func);
}
public class Sha256
{
public static bool IsSupported { get; }
public static Vector128<byte> MessageSchedule1(Vector128<byte> a, Vector128<byte> b);
public static Vector128<byte> MessageSchedule2(Vector128<byte> a, Vector128<byte> b);
public static Vector128<byte> TwoRounds(Vector128<byte> a, Vector128<byte> b, Vector128<byte> k);
}
} Current state of implementation
Used intrinsics
TestsI think including tests for this is not relevant, since we trust the processor to execute the intrinsics correctly (there are only vector tests in System.Runtime.Intrinsics anyway). /cc @tannergooding
|
I'm working on the JIT implementation for these intrinsics (see deeprobin#3). Happy to review 😄 |
Please let us know if you need any assistance here. There are a number of steps required to support new ISAs and you'll need to touch code in both the JIT and VM. |
Yes, I need some assistance. Thats my current JIT change: deeprobin#3 |
* JIT implementation for SHA instructions * Fix flags * Add `cpuid` check for SHA (29th bit) * Add EnableSHA config value * Add incomplete CodeGen method called `genSHAIntrinsic`
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
This reverts commit 98a22f2.
Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it. |
@tannergooding This was auto-closed. As soon as you have time to look at the bug in the wrong SHA encoding, feel free to reopen the PR :) |
Proposal implementation of #256 (closes #256)
Proposal
Current state of implementation
Used intrinsics
__m128i _mm_sha1msg1_epu32 (__m128i a, __m128i b)
__m128i _mm_sha1msg2_epu32 (__m128i a, __m128i b)
__m128i _mm_sha1nexte_epu32 (__m128i a, __m128i b)
__m128i _mm_sha1rnds4_epu32 (__m128i a, __m128i b, const int func)
__m128i _mm_sha256msg1_epu32 (__m128i a, __m128i b)
__m128i _mm_sha256msg2_epu32 (__m128i a, __m128i b)
__m128i _mm_sha256rnds2_epu32 (__m128i a, __m128i b, __m128i k)
/cc @tannergooding