Open benaadams opened 1 year ago
I couldn't figure out the best area label to add to this issue. 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 See info in area-owners.md if you want to be subscribed.
Author: | benaadams |
---|---|
Assignees: | - |
Labels: | `api-suggestion`, `area-System.Runtime.Intrinsics`, `untriaged` |
Milestone: | - |
It would take a lot of JIT work to be able to expose the intrinsics with these API surfaces. The JIT today does not model CPU flags at a level where it can safely allow this kind of interaction with them and may itself insert instructions that clobber the flags at arbitrary points.
Somewhat related: #74867
Marking this as blocked
given its something we'd like to support/expose, but we can't until the relevant JIT work happens.
Is there any update if and when this could happen? It blocks us from optimizing cryptography in our codebase.
Background and motivation
ADCX
andADOX
have been introduced in combination withMULX
to maintain independent carry chains so large integer multiplication can be parrallelised: Intel: New Instructions Supporting Large Integer Arithmetic and Intel: Large Integer Squaring so they cannot be easily written in C# directly (third column):API Proposal
API Usage
Alternative Designs
Return the CF, OF flags from the methods as per the C/C++ function
However this just complicates the usage and the optimization that the Jit needs to do to undo the temporary variables which are just passed to next function.
Additional methods have been added to extract the flag if necessary.
Risks
No response