Skip to content

[Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - add MMX/SSE/AVX/AVX512 AVG intrinsics to be used in constexpr #155390

@RKSimon

Description

@RKSimon

The PAVGB/PAVGW intrinsics can all be used in constexpr with suitable handling of the __builtin_ia32_pavg builtins inside VectorExprEvaluator::VisitCallExpr and InterBuiltin.cpp similar to #152540

_mm_avg_pu8
_mm_avg_epu8 _mm256_avg_epu8 _mm512_avg_epu8
_mm_mask_avg_epu8 _mm256_mask_avg_epu8 _mm512_mask_avg_epu8
_mm_maskz_avg_epu8 _mm256_maskz_avg_epu8 _mm512_maskz_avg_epu8

_mm_avg_pu16
_mm_avg_epu16 _mm256_avg_epu16 _mm512_avg_epu16
_mm_mask_avg_epu16 _mm256_mask_avg_epu16 _mm512_mask_avg_epu16
_mm_maskz_avg_epu16 _mm256_maskz_avg_epu16 _mm512_maskz_avg_epu16

These all just need to call APIntOps::avgCeilU - and the builtin types should probably be converted to unsigned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:X86clang:frontendLanguage frontend issues, e.g. anything involving "Sema"clang:headersHeaders provided by Clang, e.g. for intrinsicsconstexprAnything related to constant evaluationgood first issuehttps://github.com/llvm/llvm-project/contribute

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions