i965/cs: Use udiv/umod for local IDs
authorJordan Justen <jordan.l.justen@intel.com>
Wed, 19 Oct 2016 17:25:21 +0000 (10:25 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Wed, 19 Oct 2016 23:51:45 +0000 (16:51 -0700)
This allows for more optimizations relating to power-of-two divisions.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_nir_intrinsics.c

index 059d14d0e4fb0f080afceb1ec63e10e664a7c6ee..9ae161f53dfe8af9dcadd6983c87d05c0a4af1b3 100644 (file)
@@ -116,7 +116,7 @@ lower_cs_intrinsics_convert_block(struct lower_intrinsics_state *state,
          uvec3.u32[2] = size[2];
          nir_ssa_def *mod_val = nir_build_imm(b, 3, 32, uvec3);
 
-         sysval = nir_imod(b, nir_idiv(b, local_index, div_val), mod_val);
+         sysval = nir_umod(b, nir_udiv(b, local_index, div_val), mod_val);
          break;
       }