The inner loop should only change the current bit of the result, instead
of the whole result.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
case 3:
for (j = valids - validd; j >= 0; j--) {
res <<= 1;
- res |= 1;
+ v = 1;
for (i = MIN(upper - j, validd); i >= 0; i--) {
- res &= (pcmp_val(s, ctrl, i + j) == pcmp_val(d, ctrl, i));
+ v &= (pcmp_val(s, ctrl, i + j) == pcmp_val(d, ctrl, i));
}
+ res |= v;
}
break;
}