Minor change

This commit is contained in:
Alexey Milovidov 2021-04-15 16:59:00 +03:00
parent 02e77c3ef1
commit bd49e696c4

View File

@ -78,12 +78,11 @@ struct ModuloByConstantImpl
if (b < 0) if (b < 0)
b = -b; b = -b;
libdivide::divider<A> divider(b);
/// Here we failed to make the SSE variant from libdivide give an advantage. /// Here we failed to make the SSE variant from libdivide give an advantage.
if (b & (b - 1)) if (b & (b - 1))
{ {
libdivide::divider<A> divider(b);
for (size_t i = 0; i < size; ++i) for (size_t i = 0; i < size; ++i)
dst[i] = src[i] - (src[i] / divider) * b; /// NOTE: perhaps, the division semantics with the remainder of negative numbers is not preserved. dst[i] = src[i] - (src[i] / divider) * b; /// NOTE: perhaps, the division semantics with the remainder of negative numbers is not preserved.
} }