Skip to content

Commit 31d0b09

Browse files
Format files
1 parent e46b536 commit 31d0b09

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4582,28 +4582,22 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
45824582
case X86::BI__builtin_ia32_kunpckhi:
45834583
case X86::BI__builtin_ia32_kunpckdi:
45844584
case X86::BI__builtin_ia32_kunpcksi:
4585-
return interp__builtin_elementwise_int_binop(S, OpPC, Call,
4586-
[](const APSInt &A,
4587-
const APSInt &B) {
4588-
// Generic kunpack: extract
4589-
// lower half of each operand
4590-
// and concatenate Result =
4591-
// (A[HalfWidth-1:0] <<
4592-
// HalfWidth) |
4593-
// B[HalfWidth-1:0]
4594-
unsigned HalfWidth =
4595-
A.getBitWidth() / 2;
4596-
APSInt Result(
4597-
A.getLoBits(HalfWidth)
4598-
.zext(A.getBitWidth()),
4599-
A.isUnsigned());
4600-
Result <<= HalfWidth;
4601-
Result |= APSInt(
4602-
B.getLoBits(HalfWidth)
4603-
.zext(B.getBitWidth()),
4604-
B.isUnsigned());
4605-
return Result;
4606-
});
4585+
return interp__builtin_elementwise_int_binop(
4586+
S, OpPC, Call, [](const APSInt &A, const APSInt &B) {
4587+
// Generic kunpack: extract
4588+
// lower half of each operand
4589+
// and concatenate Result =
4590+
// (A[HalfWidth-1:0] <<
4591+
// HalfWidth) |
4592+
// B[HalfWidth-1:0]
4593+
unsigned HalfWidth = A.getBitWidth() / 2;
4594+
APSInt Result(A.getLoBits(HalfWidth).zext(A.getBitWidth()),
4595+
A.isUnsigned());
4596+
Result <<= HalfWidth;
4597+
Result |= APSInt(B.getLoBits(HalfWidth).zext(B.getBitWidth()),
4598+
B.isUnsigned());
4599+
return Result;
4600+
});
46074601

46084602
case X86::BI__builtin_ia32_phminposuw128:
46094603
return interp__builtin_ia32_phminposuw(S, OpPC, Call);

clang/lib/AST/ExprConstant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16300,7 +16300,8 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
1630016300
unsigned HalfWidth = A.getBitWidth() / 2;
1630116301
APSInt Result(A.getLoBits(HalfWidth).zext(A.getBitWidth()), A.isUnsigned());
1630216302
Result <<= HalfWidth;
16303-
Result |= APSInt(B.getLoBits(HalfWidth).zext(B.getBitWidth()), B.isUnsigned());
16303+
Result |=
16304+
APSInt(B.getLoBits(HalfWidth).zext(B.getBitWidth()), B.isUnsigned());
1630416305
return Success(Result, E);
1630516306
}
1630616307

@@ -16430,7 +16431,6 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
1643016431
return Success(APValue(Result), E);
1643116432
}
1643216433

16433-
1643416434
case X86::BI__builtin_ia32_kaddqi:
1643516435
case X86::BI__builtin_ia32_kaddhi:
1643616436
case X86::BI__builtin_ia32_kaddsi:

0 commit comments

Comments
 (0)