@@ -4582,28 +4582,22 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
45824582 case X86::BI__builtin_ia32_kunpckhi:
45834583 case X86::BI__builtin_ia32_kunpckdi:
45844584 case X86::BI__builtin_ia32_kunpcksi:
4585- return interp__builtin_elementwise_int_binop (S, OpPC, Call,
4586- [](const APSInt &A,
4587- const APSInt &B) {
4588- // Generic kunpack: extract
4589- // lower half of each operand
4590- // and concatenate Result =
4591- // (A[HalfWidth-1:0] <<
4592- // HalfWidth) |
4593- // B[HalfWidth-1:0]
4594- unsigned HalfWidth =
4595- A.getBitWidth () / 2 ;
4596- APSInt Result (
4597- A.getLoBits (HalfWidth)
4598- .zext (A.getBitWidth ()),
4599- A.isUnsigned ());
4600- Result <<= HalfWidth;
4601- Result |= APSInt (
4602- B.getLoBits (HalfWidth)
4603- .zext (B.getBitWidth ()),
4604- B.isUnsigned ());
4605- return Result;
4606- });
4585+ return interp__builtin_elementwise_int_binop (
4586+ S, OpPC, Call, [](const APSInt &A, const APSInt &B) {
4587+ // Generic kunpack: extract
4588+ // lower half of each operand
4589+ // and concatenate Result =
4590+ // (A[HalfWidth-1:0] <<
4591+ // HalfWidth) |
4592+ // B[HalfWidth-1:0]
4593+ unsigned HalfWidth = A.getBitWidth () / 2 ;
4594+ APSInt Result (A.getLoBits (HalfWidth).zext (A.getBitWidth ()),
4595+ A.isUnsigned ());
4596+ Result <<= HalfWidth;
4597+ Result |= APSInt (B.getLoBits (HalfWidth).zext (B.getBitWidth ()),
4598+ B.isUnsigned ());
4599+ return Result;
4600+ });
46074601
46084602 case X86::BI__builtin_ia32_phminposuw128:
46094603 return interp__builtin_ia32_phminposuw (S, OpPC, Call);
0 commit comments