@@ -666,16 +666,6 @@ static bool interp__builtin_abs(InterpState &S, CodePtr OpPC,
666
666
return true ;
667
667
}
668
668
669
- static bool interp__builtin_knot (InterpState &S, CodePtr OpPC,
670
- const InterpFrame *Frame,
671
- const CallExpr *Call) {
672
- APSInt Val =
673
- popToAPSInt (S.Stk , *S.getContext ().classify (Call->getArg (0 )->getType ()));
674
- APInt Result = ~Val;
675
- pushInteger (S, APSInt (std::move (Result), true ), Call->getType ());
676
- return true ;
677
- }
678
-
679
669
static bool interp__builtin_popcount (InterpState &S, CodePtr OpPC,
680
670
const InterpFrame *Frame,
681
671
const CallExpr *Call) {
@@ -3659,7 +3649,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
3659
3649
case X86::BI__builtin_ia32_knothi:
3660
3650
case X86::BI__builtin_ia32_knotsi:
3661
3651
case X86::BI__builtin_ia32_knotdi:
3662
- return interp__builtin_knot (S, OpPC, Frame, Call);
3652
+ return interp__builtin_elementwise_int_unaryop (
3653
+ S, OpPC, Call, [](const APSInt &Src) { return ~Src; });
3663
3654
3664
3655
case X86::BI__builtin_ia32_kaddqi:
3665
3656
case X86::BI__builtin_ia32_kaddhi:
0 commit comments