Skip to content

Apply ConstantExpected attribute in runtime repo APIs as needed #63426

Closed

Description

@buyaa-n

With #62436 we added a new ConstantExpectedAttribute to express that only constant value is expected for a parameter. Now we need to apply that parameter to the APIs parameters needs it. This issue is for tracking the APIs needs this attribute

As far as I know, we need to add this to the byte count parameter for the following APIs:

public static Vector256<short> ShiftLeftLogical(Vector256<short> value, byte count) => ShiftLeftLogical(value, count);
/// <summary>
/// __m256i _mm256_slli_epi16 (__m256i a, int imm8)
/// VPSLLW ymm, ymm, imm8
/// </summary>
public static Vector256<ushort> ShiftLeftLogical(Vector256<ushort> value, byte count) => ShiftLeftLogical(value, count);
/// <summary>
/// __m256i _mm256_slli_epi32 (__m256i a, int imm8)
/// VPSLLD ymm, ymm, imm8
/// </summary>
public static Vector256<int> ShiftLeftLogical(Vector256<int> value, byte count) => ShiftLeftLogical(value, count);
/// <summary>
/// __m256i _mm256_slli_epi32 (__m256i a, int imm8)
/// VPSLLD ymm, ymm, imm8
/// </summary>
public static Vector256<uint> ShiftLeftLogical(Vector256<uint> value, byte count) => ShiftLeftLogical(value, count);
/// <summary>
/// __m256i _mm256_slli_epi64 (__m256i a, int imm8)
/// VPSLLQ ymm, ymm, imm8
/// </summary>
public static Vector256<long> ShiftLeftLogical(Vector256<long> value, byte count) => ShiftLeftLogical(value, count);
/// <summary>
/// __m256i _mm256_slli_epi64 (__m256i a, int imm8)
/// VPSLLQ ymm, ymm, imm8
/// </summary>
public static Vector256<ulong> ShiftLeftLogical(Vector256<ulong> value, byte count) => ShiftLeftLogical(value, count);

@GrabYourPitchforks @tannergooding please add the other APIs/parameters needs the attribute.

See @stephentoub's comment in #62436 (comment)

Activity

  1. ghost added
    untriaged
    on Jan 6, 2022
  2. added this to the 7.0.0 milestone on Jan 6, 2022
  3. removed
    untriaged
    on Jan 11, 2022
  4. wzchua commented on May 29, 2022

    @wzchua
    Contributor

    If I'm not mistaken the intrinsic that has imm8 would need the attribute

  5. wzchua commented on Jul 30, 2022

    @wzchua
    Contributor
  6. buyaa-n commented on Aug 2, 2022

    @buyaa-n
    ContributorAuthor

    @tannergooding please check @wzchua's commits that applying the attributes, or do you want them to raise a PR? Probably that is easier for review and discuss if needed

  7. modified the milestones: 7.0.0, Future on Aug 8, 2022
  8. added
    code-analyzer
    on Aug 8, 2022
  9. removed
    code-analyzer
    on Nov 9, 2022
  10. tannergooding commented on Jul 23, 2026

    @tannergooding
    Member

    We've applied this to all the relevant intrinsics already

  11. locked and limited conversation to collaborators on Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions