runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Refactor handling of two immediates in hwintrinsic

Open a74nh opened this issue 1 year ago • 2 comments

Out of all the existing hwintrinsics, only NI_AdvSimd_Arm64_InsertSelectedScalar has two immediate values. This also has the property that both immediates are of the same type, therefore handling of the type information and type checking can be simplified for the second immediate.

For Sve, SaturatingIncrementBy*ElementCount, SaturatingDecrementBy*ElementCount, and MultiplyAddRotateComplexBySelectedScalar all require two immediate values. In addition for the Saturating functions, the immediates have different types.

This PR refactors the existing handling so that it will work for Sve. It does not add any new Sve intrinsics.

  • Move checks for specific intrinsics out of common code into Arm64 files
  • Handle the type the second immediate separately to the type of the first.

The code still feels a little clunky, but I hope impHWIntrinsic() is much easier to parse now.

a74nh avatar May 10 '24 09:05 a74nh

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.

@kunalspathak @tannergooding @dotnet/arm64-contrib This is ready. A perquisite for SaturatingIncrementBy*ElementCount

a74nh avatar May 10 '24 13:05 a74nh

/azp run runtime-coreclr superpmi-replay, runtime-coreclr superpmi-diffs

kunalspathak avatar May 13 '24 13:05 kunalspathak

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar May 13 '24 13:05 azure-pipelines[bot]