Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Proposal: Arm64 Simd BitwiseSelect #24586

Closed
sdmaclea opened this issue Jan 5, 2018 · 5 comments
Closed

API Proposal: Arm64 Simd BitwiseSelect #24586

sdmaclea opened this issue Jan 5, 2018 · 5 comments
Assignees
Labels
api-approved API was approved in API review, it can be implemented arch-arm64 area-System.Runtime.Intrinsics help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@sdmaclea
Copy link
Contributor

sdmaclea commented Jan 5, 2018

@eerhardt @CarolEidt @RussKeldorph

Target Framework netcoreapp2.1

namespace System.Runtime.Intrinsics.Arm.Arm64
{
    /// <summary>
    /// This class provides access to the Arm64 AdvSIMD intrinsics
    ///
    /// Arm64 CPUs indicate support for this feature by setting
    /// ID_AA64PFR0_EL1.AdvSIMD == 0 or better.
    /// </summary>
    public static class Simd
    {
        public static bool IsSupported { get { throw null; } }

        /// <summary>
        /// Vector BitwiseSelect
        /// For each bit in the vector result[bit] = sel[bit] ? left[bit] : right[bit]
        /// Corresponds to vector forms of ARM64 BSL (Also BIF & BIT)
        /// </summary>
        public static Vector64<T>  BitwiseSelect<T>(Vector64<T>  sel, Vector64<T>  left, Vector64<T>  right) where T : struct { throw null; }
        public static Vector128<T> BitwiseSelect<T>(Vector128<T> sel, Vector128<T> left, Vector128<T> right) where T : struct { throw null; }
    }
}
@sdmaclea
Copy link
Contributor Author

sdmaclea commented Jan 5, 2018

My current understanding is the difference between BSL, BIT, BIF is simply which of the 3 source registers is used as the destination register. Therefore I am using the same intrinsic for all of them. This may give more flexibility to the register allocator.

@sdmaclea
Copy link
Contributor Author

sdmaclea commented Jan 5, 2018

Updated to use generics

@sdmaclea
Copy link
Contributor Author

@CarolEidt @eerhardt I think this can be marked "API-ready-for-review"

@sdmaclea
Copy link
Contributor Author

sdmaclea commented Feb 5, 2018

@eerhardt Any reason why this is marked future? The CoreCLR work is complete and ready for 2.1.

@terrajobst
Copy link
Member

Looks good as proposed. Feedback:

  • The parameter should be spelled out "select", or whatever the spec calls it.
  • If we expand the generics, the first argument should be an int-based type

@echesakov echesakov self-assigned this Oct 16, 2019
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 5.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-approved API was approved in API review, it can be implemented arch-arm64 area-System.Runtime.Intrinsics help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

No branches or pull requests

4 participants