for (unsigned i = 0; i < 4; i++) {
nir_ssa_def *carry = NULL;
for (unsigned j = 0; j < 4; j++) {
- /* The maximum values of x32[i] and y32[i] are UINT32_MAX so the
+ /* The maximum values of x32[i] and y32[j] are UINT32_MAX so the
* maximum value of tmp is UINT32_MAX * UINT32_MAX. The maximum
* value that will fit in tmp is
*
* so we're guaranteed that we can add in two more 32-bit values
* without overflowing tmp.
*/
- nir_ssa_def *tmp = nir_umul_2x32_64(b, x32[i], y32[i]);
+ nir_ssa_def *tmp = nir_umul_2x32_64(b, x32[i], y32[j]);
if (res[i + j])
tmp = nir_iadd(b, tmp, nir_u2u64(b, res[i + j]));