Open
Description
Background and motivation
Now the GCC had merged the LoongArch's SIMD.
https://github.com/gcc-mirror/gcc/blob/master/gcc/config/loongarch/lsxintrin.h
https://github.com/gcc-mirror/gcc/blob/master/gcc/config/loongarch/lasxintrin.h
Also the LLVM is merging the LoongArch's SIMD.
I think it's time to add the LoongArch's SIMD for CoreCLR.
There is a draft PR #94400 for the LoongArch's SIMD for CoreCLR.
API Proposal
namespace System.Runtime.Intrinsics.LoongArch
{
/// <summary>
/// This class provides access to the LA64 base hardware instructions via intrinsics
/// </summary>
[Intrinsic]
[CLSCompliant(false)]
public abstract class LABase
{
internal LABase() { }
public static bool IsSupported { get => IsSupported; }
[Intrinsic]
public abstract class LoongArch64
{
// Some APIs for LoongArch64.
}
// Some APIs for LoongArch32/64 shared.
}
}
I will upload these APIs later classified by different types.
API Usage
if (LABase.IsSupported)
{
return LABase.TrailingZeroCount(value);
}
Alternative Designs
No response
Risks
No response