-
Couldn't load subscription status.
- Fork 5.2k
Description
We've iteratively exposed support for various levels of hardware intrinsics since .NET Core 3.1. In .NET 7, we exposed the new "cross platform" hardware intrinsics which aim to help simplify the writing and maintenance of SIMD code meant to run across a variety of platforms.
As such, we should provide a code fixer that identifies such platform specific calls and suggests the simple transformation to the equivalent cross platform calls.
Category: Maintainability or Portability seem like the best fit. I could also see this being classified as Usage
Severity = suggestion
Example
A simple example is given below. The full list of APIs recognized is of course more expansive but effectively correlates to a platform specific ISA such as Sse.Add, Sse2.Add, Avx.Add, Avx2.Add, AdvSimd.Add, or PackedSimd.Add correlating to a singular cross platform API, such as operator +:
- return Sse.Add(Sse.Multiply(left, right), addend);
+ return (left * right) + addend;