diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2025-09-05 21:14:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-05 20:14:29 +0000 |
commit | 13d50c24a083a04355b37d45aae6b4ba9fc294af (patch) | |
tree | 2ab073f530ca7f18b086504d62bda58d1dbec319 /clang/lib/AST/ByteCode/InterpBuiltin.cpp | |
parent | 719b92dfb14cceb9e17eadda301bfb759d0778d7 (diff) | |
download | llvm-13d50c24a083a04355b37d45aae6b4ba9fc294af.zip llvm-13d50c24a083a04355b37d45aae6b4ba9fc294af.tar.gz llvm-13d50c24a083a04355b37d45aae6b4ba9fc294af.tar.bz2 |
[X86][bytecode] Allow SSE/AVX BLENDVPD/PD intrinsics to be used in constexpr (#157126)
BLENDV intrinsics use the signbit of the condition mask to select
between the LHS (false) and RHS (true) operands
Fixes #157066
Diffstat (limited to 'clang/lib/AST/ByteCode/InterpBuiltin.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/InterpBuiltin.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp index 4d3d639..a0dcdac 100644 --- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp +++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp @@ -3421,6 +3421,15 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call, return F; }); + case clang::X86::BI__builtin_ia32_blendvpd: + case clang::X86::BI__builtin_ia32_blendvpd256: + case clang::X86::BI__builtin_ia32_blendvps: + case clang::X86::BI__builtin_ia32_blendvps256: + return interp__builtin_elementwise_triop_fp( + S, OpPC, Call, + [](const APFloat &F, const APFloat &T, const APFloat &C, + llvm::RoundingMode) { return C.isNegative() ? T : F; }); + case clang::X86::BI__builtin_ia32_pblendvb128: case clang::X86::BI__builtin_ia32_pblendvb256: return interp__builtin_elementwise_triop( |