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