Skip to content

Commit c9007bf

Browse files
committed
Fix style and format
1 parent 7dce6c6 commit c9007bf

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4474,14 +4474,13 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
44744474
return interp__builtin_ia32_shuffle_generic(
44754475
S, OpPC, Call, [](unsigned DstIdx, unsigned ShuffleMask) {
44764476
uint8_t Ctlb = static_cast<uint8_t>(ShuffleMask);
4477-
if (Ctlb & 0x80) {
4477+
if (Ctlb & 0x80)
44784478
return std::make_pair(0, -1);
4479-
} else {
4479+
44804480
unsigned LaneBase = (DstIdx / 16) * 16;
44814481
unsigned SrcOffset = Ctlb & 0x0F;
44824482
unsigned SrcIdx = LaneBase + SrcOffset;
44834483
return std::make_pair(0, static_cast<int>(SrcIdx));
4484-
}
44854484
});
44864485

44874486
case X86::BI__builtin_ia32_pshuflw:
@@ -4494,9 +4493,9 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
44944493
if (LaneIdx < 4) {
44954494
unsigned Sel = (ShuffleMask >> (2 * LaneIdx)) & 0x3;
44964495
return std::make_pair(0, static_cast<int>(LaneBase + Sel));
4497-
} else {
4498-
return std::make_pair(0, static_cast<int>(DstIdx));
44994496
}
4497+
4498+
return std::make_pair(0, static_cast<int>(DstIdx));
45004499
});
45014500

45024501
case X86::BI__builtin_ia32_pshufhw:
@@ -4509,7 +4508,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
45094508
if (LaneIdx >= 4) {
45104509
unsigned Sel = (ShuffleMask >> (2 * (LaneIdx - 4))) & 0x3;
45114510
return std::make_pair(0, static_cast<int>(LaneBase + 4 + Sel));
4512-
} else {
4511+
}
4512+
45134513
return std::make_pair(0, static_cast<int>(DstIdx));
45144514
}
45154515
});
@@ -4686,12 +4686,11 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
46864686
[](unsigned DstIdx, unsigned Shift) -> std::pair<unsigned, int> {
46874687
unsigned LaneBase = (DstIdx / 16) * 16;
46884688
unsigned LaneIdx = DstIdx % 16;
4689-
if (LaneIdx < Shift) {
4689+
if (LaneIdx < Shift)
46904690
return std::make_pair(0, -1);
4691-
}
4692-
4693-
return std::make_pair(0, static_cast<int>(LaneBase + LaneIdx - Shift));
46944691

4692+
return std::make_pair(0,
4693+
static_cast<int>(LaneBase + LaneIdx - Shift));
46954694
});
46964695

46974696
case X86::BI__builtin_ia32_psrldqi128_byteshift:
@@ -4706,9 +4705,9 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
47064705
[](unsigned DstIdx, unsigned Shift) -> std::pair<unsigned, int> {
47074706
unsigned LaneBase = (DstIdx / 16) * 16;
47084707
unsigned LaneIdx = DstIdx % 16;
4709-
if (LaneIdx + Shift < 16) {
4710-
return std::make_pair(0, static_cast<int>(LaneBase + LaneIdx + Shift));
4711-
}
4708+
if (LaneIdx + Shift < 16)
4709+
return std::make_pair(0,
4710+
static_cast<int>(LaneBase + LaneIdx + Shift));
47124711

47134712
return std::make_pair(0, -1);
47144713
});

clang/lib/AST/ExprConstant.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12929,7 +12929,8 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1292912929
APValue R;
1293012930
if (!evalShuffleGeneric(
1293112931
Info, E, R,
12932-
[](unsigned DstIdx, unsigned ShuffleMask) -> std::pair<unsigned, int> {
12932+
[](unsigned DstIdx,
12933+
unsigned ShuffleMask) -> std::pair<unsigned, int> {
1293312934
uint8_t Ctlb = static_cast<uint8_t>(ShuffleMask);
1293412935
if (Ctlb & 0x80) {
1293512936
return std::make_pair(0, -1);
@@ -12961,7 +12962,7 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1296112962
unsigned Sel = (Mask >> (2 * LaneIdx)) & 0x3;
1296212963
return std::make_pair(0, static_cast<int>(LaneBase + Sel));
1296312964
}
12964-
return std::make_pair(0, static_cast<int>(DstIdx));
12965+
return std::make_pair(0, static_cast<int>(DstIdx));
1296512966
}))
1296612967
return false;
1296712968
return Success(R, E);
@@ -12983,9 +12984,10 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1298312984
if (LaneIdx >= HalfSize) {
1298412985
unsigned Rel = LaneIdx - HalfSize;
1298512986
unsigned Sel = (Mask >> (2 * Rel)) & 0x3;
12986-
return std::make_pair(0, static_cast<int>(LaneBase + HalfSize + Sel));
12987+
return std::make_pair(
12988+
0, static_cast<int>(LaneBase + HalfSize + Sel));
1298712989
}
12988-
return std::make_pair(0, static_cast<int>(DstIdx));
12990+
return std::make_pair(0, static_cast<int>(DstIdx));
1298912991
}))
1299012992
return false;
1299112993
return Success(R, E);
@@ -13491,14 +13493,15 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1349113493
[](unsigned DstIdx, unsigned Shift) -> std::pair<unsigned, int> {
1349213494
unsigned LaneBase = (DstIdx / 16) * 16;
1349313495
unsigned LaneIdx = DstIdx % 16;
13494-
if (LaneIdx < Shift) {
13496+
if (LaneIdx < Shift)
1349513497
return std::make_pair(0, -1);
13496-
}
13497-
return std::make_pair(0, static_cast<int>(LaneBase + LaneIdx - Shift));
13498+
13499+
return std::make_pair(
13500+
0, static_cast<int>(LaneBase + LaneIdx - Shift));
1349813501
}))
1349913502
return false;
1350013503
return Success(R, E);
13501-
}
13504+
}
1350213505

1350313506
case X86::BI__builtin_ia32_psrldqi128_byteshift:
1350413507
case X86::BI__builtin_ia32_psrldqi256_byteshift:
@@ -13509,14 +13512,15 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1350913512
[](unsigned DstIdx, unsigned Shift) -> std::pair<unsigned, int> {
1351013513
unsigned LaneBase = (DstIdx / 16) * 16;
1351113514
unsigned LaneIdx = DstIdx % 16;
13512-
if (LaneIdx + Shift < 16) {
13513-
return std::make_pair(0, static_cast<int>(LaneBase + LaneIdx + Shift));
13514-
}
13515-
return std::make_pair(0, -1);
13515+
if (LaneIdx + Shift < 16)
13516+
return std::make_pair(
13517+
0, static_cast<int>(LaneBase + LaneIdx + Shift));
13518+
13519+
return std::make_pair(0, -1);
1351613520
}))
1351713521
return false;
1351813522
return Success(R, E);
13519-
}
13523+
}
1352013524
case X86::BI__builtin_ia32_vpermi2varq128:
1352113525
case X86::BI__builtin_ia32_vpermi2varpd128: {
1352213526
APValue R;

0 commit comments

Comments
 (0)