Skip to content

Commit

Permalink
Revert "[HVX] Simplify constant factor before distributing" (#7013)
Browse files Browse the repository at this point in the history
Revert "[HVX] Simplify constant factor before distributing (#7009)"

This reverts commit 69b50af.
  • Loading branch information
steven-johnson authored Sep 14, 2022
1 parent ace8028 commit 18b06f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions src/HexagonOptimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2177,10 +2177,8 @@ class DistributeShiftsAsMuls : public IRMutator {
}
} else if (op->is_intrinsic(Call::widening_shift_left)) {
if (const uint64_t *const_b = as_const_uint(op->args[1])) {
const uint64_t const_m = 1ull << *const_b;
Expr b = make_const(op->type, const_m);
Expr a = Cast::make(op->type, op->args[0]);
return mutate(distribute(a, b));
return mutate(distribute(a, make_one(a.type()) << *const_b));
}
}
return IRMutator::visit(op);
Expand Down
1 change: 0 additions & 1 deletion test/correctness/simd_op_check_hvx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ class SimdOpCheckHVX : public SimdOpCheckTest {
check("v*.h += vmpy(v*.ub,r*.b)", hvx_width / 1, i16_1 + 127 * i16(u8_1));
check("v*.uw += vmpy(v*.uh,r*.uh)", hvx_width / 2, u32_1 + 65535 * u32(u16_1));

check("v*.h += vmpy(v*.b,v*.b)", hvx_width / 1, i16_1 + 2 * i16(i8_1));
check("v*.h += vmpy(v*.ub,r*.b)", hvx_width / 1, i16_1 - i16(u8_1) * -127);
check("v*.h += vmpyi(v*.h,r*.b)", hvx_width / 2, i16_1 - i16_2 * -127);

Expand Down

0 comments on commit 18b06f0

Please sign in to comment.