Skip to content

[Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - allow shufps/pd shuffles intrinsics to be used in constexp #161208

@RKSimon

Description

@RKSimon
_mm_shuffle_ps / _mm256_shuffle_ps / _mm512_shuffle_ps
_mm_mask_shuffle_ps / _mm256_mask_shuffle_ps / _mm512_mask_shuffle_ps
_mm_maskz_shuffle_ps / _mm256_maskz_shuffle_ps / _mm512_maskz_shuffle_ps

_mm_shuffle_pd / _mm256_shuffle_pd / _mm512_shuffle_pd
_mm_mask_shuffle_pd / _mm256_mask_shuffle_pd / _mm512_mask_shuffle_pd
_mm_maskz_shuffle_pd / _mm256_maskz_shuffle_pd / _mm512_maskz_shuffle_pd

Handle the underlying __builtin_ia32_shufps/pd builtins and add test coverage.

Consult the Intel Intrinsics Guide to understand the nuances of the SHUFPS/PD shuffles - including repetition across lanes, LHS/RHS halves etc. - the expansion in CodeGenFunction::EmitX86BuiltinExpr should help as well.

Ideally this can be done with relatively generically to simplify adding other shuffles in the future.

Metadata

Metadata

Assignees

Labels

backend:X86clang:bytecodeIssues for the clang bytecode constexpr interpreterconstexprAnything 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