[clang] [Clang] Allow VDBPSADBW intrinsics in constexpr (PR #188887)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 27 03:54:02 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions c,cpp -- clang/lib/AST/ByteCode/InterpBuiltin.cpp clang/lib/AST/ExprConstant.cpp clang/test/CodeGen/X86/avx512bw-builtins.c clang/test/CodeGen/X86/avx512vlbw-builtins.c --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index d9a14f84e..e7a487198 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -2855,10 +2855,14 @@ static bool interp__builtin_ia32_dbpsadbw(InterpState &S, CodePtr OpPC,
unsigned A1Val, A2Val, BVal;
INT_TYPE_SWITCH_NO_BOOL(SrcElemT, {
// Treat as unsigned bytes
- A1Val = static_cast<uint8_t>(
- Src1.elem<T>(LaneStart + BlockOffsetA + K).toAPSInt().getZExtValue());
- A2Val = static_cast<uint8_t>(
- Src1.elem<T>(LaneStart + BlockOffsetB + K).toAPSInt().getZExtValue());
+ A1Val =
+ static_cast<uint8_t>(Src1.elem<T>(LaneStart + BlockOffsetA + K)
+ .toAPSInt()
+ .getZExtValue());
+ A2Val =
+ static_cast<uint8_t>(Src1.elem<T>(LaneStart + BlockOffsetB + K)
+ .toAPSInt()
+ .getZExtValue());
BVal = static_cast<uint8_t>(
Src2.elem<T>(LaneStart + 4 * J + K).toAPSInt().getZExtValue());
});
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index fc4a4834b..2a6e1713f 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -12599,10 +12599,10 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
SourceA.getVectorElt(LaneStart + BlockOffsetA + K)
.getInt()
.getZExtValue());
- unsigned B = static_cast<uint8_t>(
- SourceB.getVectorElt(LaneStart + 4 * J + K)
- .getInt()
- .getZExtValue());
+ unsigned B =
+ static_cast<uint8_t>(SourceB.getVectorElt(LaneStart + 4 * J + K)
+ .getInt()
+ .getZExtValue());
SadA += (B > A) ? (B - A) : (A - B);
unsigned A2 = static_cast<uint8_t>(
``````````
</details>
https://github.com/llvm/llvm-project/pull/188887
More information about the cfe-commits
mailing list