llvm/llvm-project

[Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - allow SSE/AVX2 VMPSADBW intrinsics to be used in constexpr

已关闭

#157,522 创建于 2025年9月8日

 (10 条评论) (0 个反应) (0 位负责人)C++ (10,782 个派生)batch import
backend:X86clang:bytecodeclang:frontendconstexprgood first issue

仓库指标

星标
 (26,378 个星标)
PR 合并指标
 (平均合并 1天 2小时) (30 天内合并 1,000 个 PR)

描述

The horizontal sum of difference intrinsics can all be used in constexpr with suitable handling of the builtins inside VectorExprEvaluator::VisitCallExpr and InterBuiltin.cpp, and testing in the relevent *-builtins.c files.

_mm_mpsadbw_epu8 _mm256_mpsadbw_epu8

These intrinsics can be tricky to correctly evaluate, so I'd recommend previous knowledge of SSE/AVX instructions is required

Care needs to be taken with the signed/unsigned extension of the arguments - we might need to adjust the builtin signatures.

贡献者指南