Skip to content

[API Proposal]: LoongArch64: add Intrinsics' API for LoongArch64 #94445

Open
@shushanhf

Description

@shushanhf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-System.Runtime.Intrinsicsneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsideration

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions