Skip to content

Commit a6b108e

Browse files
authored
Hoisted selection variable declaration in InterpBuiltin.cpp
1 parent 689994a commit a6b108e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,19 +2796,18 @@ static bool interp__builtin_ia32_pshuf(InterpState &S, CodePtr OpPC,
27962796
unsigned LaneBase = (Idx / LaneElts) * LaneElts;
27972797
unsigned LaneIdx = Idx % LaneElts;
27982798
unsigned SrcIdx = Idx;
2799-
2799+
unsigned Sel = (Ctl >> (2 * LaneIdx)) & 0x3;
2800+
28002801
if (ElemBits == 32) {
2801-
unsigned Sel = (Ctl >> (2 * LaneIdx)) & 0x3;
28022802
SrcIdx = LaneBase + Sel;
28032803
} else {
28042804
constexpr unsigned HalfSize = 4;
28052805
bool InHigh = LaneIdx >= HalfSize;
28062806
if (!IsShufHW && !InHigh) {
2807-
unsigned Sel = (Ctl >> (2 * LaneIdx)) & 0x3;
28082807
SrcIdx = LaneBase + Sel;
28092808
} else if (IsShufHW && InHigh) {
28102809
unsigned Rel = LaneIdx - HalfSize;
2811-
unsigned Sel = (Ctl >> (2 * Rel)) & 0x3;
2810+
Sel = (Ctl >> (2 * Rel)) & 0x3;
28122811
SrcIdx = LaneBase + HalfSize + Sel;
28132812
}
28142813
}

0 commit comments

Comments
 (0)