-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Open
Labels
backend:X86clang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsicsconstexprAnything related to constant evaluationAnything related to constant evaluationgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
Handle the elementwise vector shift intrinsics inside VectorExprEvaluator::VisitCallExpr and add constexpr test coverage, similar to #152524
_mm*_sllv_epi16 _mm*_srlv_epi16 _mm*_srav_epi16
_mm*_sllv_epi32 _mm*_srlv_epi32 _mm*_srav_epi32
_mm*_sllv_epi64 _mm*_srlv_epi64 _mm*_srav_epi64
_mm*_mask_sllv_epi16 _mm*_mask_srlv_epi16 _mm*_mask_srav_epi16
_mm*_mask_sllv_epi32 _mm*_mask_srlv_epi32 _mm*_mask_srav_epi32
_mm*_mask_sllv_epi64 _mm*_mask_srlv_epi64 _mm*_mask_srav_epi64
_mm*_maskz_sllv_epi16 _mm*_maskz_srlv_epi16 _mm*_maskz_srav_epi16
_mm*_maskz_sllv_epi32 _mm*_maskz_srlv_epi32 _mm*_maskz_srav_epi32
_mm*_maskz_sllv_epi64 _mm*_maskz_srlv_epi64 _mm*_maskz_srav_epi64
for 128/256/512 variants
The shift intrinsics have special case handling for out of bounds (elementwise) shift amounts, for logical shifts if the unsigned amount is greater than or equal to the element bitwidth then the result is 0. For arithmetic shifts, the shift amount is clamped to (bitwidth-1) to splat the sign bit.
Metadata
Metadata
Assignees
Labels
backend:X86clang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsicsconstexprAnything related to constant evaluationAnything related to constant evaluationgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute