@@ -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 {
4480- unsigned LaneBase = (DstIdx / 16 ) * 16 ;
4481- unsigned SrcOffset = Ctlb & 0x0F ;
4482- unsigned SrcIdx = LaneBase + SrcOffset;
4483- return std::make_pair (0 , static_cast <int >(SrcIdx));
4484- }
4479+
4480+ unsigned LaneBase = (DstIdx / 16 ) * 16 ;
4481+ unsigned SrcOffset = Ctlb & 0x0F ;
4482+ unsigned SrcIdx = LaneBase + SrcOffset;
4483+ return std::make_pair (0 , static_cast <int >(SrcIdx));
44854484 });
44864485
44874486 case X86::BI__builtin_ia32_pshuflw:
@@ -4494,25 +4493,25 @@ 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:
45034502 case X86::BI__builtin_ia32_pshufhw256:
45044503 case X86::BI__builtin_ia32_pshufhw512:
45054504 return interp__builtin_ia32_shuffle_generic (
45064505 S, OpPC, Call, [](unsigned DstIdx, unsigned ShuffleMask) {
4507- unsigned LaneBase = (DstIdx / 8 ) * 8 ;
4508- unsigned LaneIdx = DstIdx % 8 ;
4509- if (LaneIdx >= 4 ) {
4510- unsigned Sel = (ShuffleMask >> (2 * (LaneIdx - 4 ))) & 0x3 ;
4511- return std::make_pair (0 , static_cast <int >(LaneBase + 4 + Sel));
4512- } else {
4513- return std::make_pair ( 0 , static_cast < int >(DstIdx));
4514- }
4515- });
4506+ unsigned LaneBase = (DstIdx / 8 ) * 8 ;
4507+ unsigned LaneIdx = DstIdx % 8 ;
4508+ if (LaneIdx >= 4 ) {
4509+ unsigned Sel = (ShuffleMask >> (2 * (LaneIdx - 4 ))) & 0x3 ;
4510+ return std::make_pair (0 , static_cast <int >(LaneBase + 4 + Sel));
4511+ }
4512+
4513+ return std::make_pair ( 0 , static_cast < int >(DstIdx));
4514+ });
45164515
45174516 case X86::BI__builtin_ia32_pshufd:
45184517 case X86::BI__builtin_ia32_pshufd256:
@@ -4686,12 +4685,11 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
46864685 [](unsigned DstIdx, unsigned Shift) -> std::pair<unsigned , int > {
46874686 unsigned LaneBase = (DstIdx / 16 ) * 16 ;
46884687 unsigned LaneIdx = DstIdx % 16 ;
4689- if (LaneIdx < Shift) {
4688+ if (LaneIdx < Shift)
46904689 return std::make_pair (0 , -1 );
4691- }
4692-
4693- return std::make_pair (0 , static_cast <int >(LaneBase + LaneIdx - Shift));
46944690
4691+ return std::make_pair (0 ,
4692+ static_cast <int >(LaneBase + LaneIdx - Shift));
46954693 });
46964694
46974695 case X86::BI__builtin_ia32_psrldqi128_byteshift:
@@ -4706,9 +4704,9 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
47064704 [](unsigned DstIdx, unsigned Shift) -> std::pair<unsigned , int > {
47074705 unsigned LaneBase = (DstIdx / 16 ) * 16 ;
47084706 unsigned LaneIdx = DstIdx % 16 ;
4709- if (LaneIdx + Shift < 16 ) {
4710- return std::make_pair (0 , static_cast < int >(LaneBase + LaneIdx + Shift));
4711- }
4707+ if (LaneIdx + Shift < 16 )
4708+ return std::make_pair (0 ,
4709+ static_cast < int >(LaneBase + LaneIdx + Shift));
47124710
47134711 return std::make_pair (0 , -1 );
47144712 });
0 commit comments