kpu/intgemm

multiply_sat shift arguments are not immediates

Opened this issue · 0 comments

srai_epi16 expects an immediate shift value, not a variable.
Here's it is called with a variable:

auto low = srai_epi16(multiply<int16_t>(upcasted_a.first, upcasted_b.first), right_shift);
auto hi = srai_epi16(multiply<int16_t>(upcasted_a.second, upcasted_b.second), right_shift);

And the caller is very much using a variable:
for (std::size_t shift = 0; shift <= 2 * 8 * sizeof(Type_); ++shift) {
*output.template as<vec_t>() = kernels::multiply_sat<Type_>(*input1.template as<vec_t>(), *input2.template as<vec_t>(), shift);

I don't know how newer gcc was fixing it (perhaps srav?) but it's breaking gcc 6.