[Mesa-dev] [PATCH] i965/cs: Use udiv/umod for local IDs
Ian Romanick
idr at freedesktop.org
Wed Oct 19 20:45:26 UTC 2016
Since I believe the index must always be >= 0, this looks correct.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
On 10/19/2016 12:40 PM, Jordan Justen wrote:
> This allows for more optimizations relating to power-of-two divisions.
>
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
> src/mesa/drivers/dri/i965/brw_nir_intrinsics.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_nir_intrinsics.c b/src/mesa/drivers/dri/i965/brw_nir_intrinsics.c
> index 059d14d..9ae161f 100644
> --- a/src/mesa/drivers/dri/i965/brw_nir_intrinsics.c
> +++ b/src/mesa/drivers/dri/i965/brw_nir_intrinsics.c
> @@ -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;
> }
>
>
More information about the mesa-dev
mailing list