@@ -2592,7 +2592,7 @@ static bool interp__builtin_ia32_pmadd(
2592
2592
const Pointer &RHS = S.Stk .pop <Pointer>();
2593
2593
const Pointer &LHS = S.Stk .pop <Pointer>();
2594
2594
const Pointer &Dst = S.Stk .peek <Pointer>();
2595
-
2595
+
2596
2596
const auto *VT = Call->getArg (0 )->getType ()->castAs <VectorType>();
2597
2597
PrimType ElemT = *S.getContext ().classify (VT->getElementType ());
2598
2598
unsigned NumElems = VT->getNumElements ();
@@ -3482,20 +3482,26 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
3482
3482
case clang::X86::BI__builtin_ia32_pmaddubsw128:
3483
3483
case clang::X86::BI__builtin_ia32_pmaddubsw256:
3484
3484
case clang::X86::BI__builtin_ia32_pmaddubsw512:
3485
- return interp__builtin_ia32_pmadd (S, OpPC, Call,
3486
- [](const APSInt &LoLHS, const APSInt &HiLHS, const APSInt &HiRHS, const APSInt &HiRHS) {
3487
- unsigned BitWidth = 2 * LHS.getBitWidth ();
3488
- return (LoLHS.zext (BitWidth) * LoRHS.sext (BitWidth)).sadd_sat ((HiLHS.zext (BitWidth) * HiRHS.sext (BitWidth)));
3489
- });
3490
-
3485
+ return interp__builtin_ia32_pmadd (
3486
+ S, OpPC, Call,
3487
+ [](const APSInt &LoLHS, const APSInt &HiLHS, const APSInt &HiRHS,
3488
+ const APSInt &HiRHS) {
3489
+ unsigned BitWidth = 2 * LHS.getBitWidth ();
3490
+ return (LoLHS.zext (BitWidth) * LoRHS.sext (BitWidth))
3491
+ .sadd_sat ((HiLHS.zext (BitWidth) * HiRHS.sext (BitWidth)));
3492
+ });
3493
+
3491
3494
case clang::X86::BI__builtin_ia32_pmaddwd128:
3492
3495
case clang::X86::BI__builtin_ia32_pmaddwd256:
3493
3496
case clang::X86::BI__builtin_ia32_pmaddwd512:
3494
- return interp__builtin_ia32_pmadd (S, OpPC, Call,
3495
- [](const APSInt &LoLHS, const APSInt &HiLHS, const APSInt &HiRHS, const APSInt &HiRHS) {
3496
- unsigned BitWidth = 2 * LHS.getBitWidth ();
3497
- return (LoLHS.sext (BitWidth) * LoRHS.sext (BitWidth)) + (HiLHS.sext (BitWidth) * HiRHS.sext (BitWidth));
3498
- });
3497
+ return interp__builtin_ia32_pmadd (
3498
+ S, OpPC, Call,
3499
+ [](const APSInt &LoLHS, const APSInt &HiLHS, const APSInt &HiRHS,
3500
+ const APSInt &HiRHS) {
3501
+ unsigned BitWidth = 2 * LHS.getBitWidth ();
3502
+ return (LoLHS.sext (BitWidth) * LoRHS.sext (BitWidth)) +
3503
+ (HiLHS.sext (BitWidth) * HiRHS.sext (BitWidth));
3504
+ });
3499
3505
3500
3506
case clang::X86::BI__builtin_ia32_pmulhuw128:
3501
3507
case clang::X86::BI__builtin_ia32_pmulhuw256:
0 commit comments