Open tannergooding opened 5 years ago
This sounds an interesting work item to me. If no one is working on it I'd like to take a look.
I went through the code for HW intrinsics, seems to add a new intrinsic we need to touch System/Runtime/Intrinsics and hwintrinsiclistxarch.h. Not sure if there's any guidance. If no I can figure it out as well.
Looking at the board of HW intrinsics, seems an API proposal is needed before implementation. If we decide to add new intrinsics, I would create separate issues for proposing them first. Not sure if this is the right process.
Since the BigInteger
ref struct exists within S.P.Corelib, the AddWithCarry
and Multiply128
intrinsics could be prototyped without going through an API proposal. That is, they can be kept internal and experimented with to get numbers and prove they are useful first.
Tagging subscribers to this area: @tannergooding Notify danmosemsft if you want to be subscribed.
The floating-point formatting/parsing code currently uses an internal
BigInteger
ref struct that would likely benefit from using specific hardware intrinsics.We should investigate using the BMI intrinsics, where possible and also look at exposing new intrinsics around
AddWithCarry
andMultiply128
, both of which can simplify some of the more complex codegen down to a single instruction. You can see https://github.com/dotnet/coreclr/pull/22040#issuecomment-458763153 for some more details and the surrounding discussion.