[Mesa-dev] [PATCH 2/2] nir: fix shift for uint64_t
Jason Ekstrand
jason at jlekstrand.net
Tue Dec 12 05:21:05 UTC 2017
How about just using 1ull?
On Mon, Dec 11, 2017 at 7:47 PM, Timothy Arceri <tarceri at itsqueeze.com>
wrote:
> ---
> src/compiler/nir/nir_lower_io_arrays_to_elements.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/compiler/nir/nir_lower_io_arrays_to_elements.c
> b/src/compiler/nir/nir_lower_io_arrays_to_elements.c
> index dca5719f114..cdf9a76a881 100644
> --- a/src/compiler/nir/nir_lower_io_arrays_to_elements.c
> +++ b/src/compiler/nir/nir_lower_io_arrays_to_elements.c
> @@ -240,21 +240,21 @@ create_indirects_mask(nir_shader *shader, uint64_t
> *indirects,
> intr->intrinsic != nir_intrinsic_interp_var_at_centroid
> &&
> intr->intrinsic != nir_intrinsic_interp_var_at_sample
> &&
> intr->intrinsic != nir_intrinsic_interp_var_at_offset)
> continue;
>
> nir_variable *var = intr->variables[0]->var;
>
> if (var->data.mode != mode)
> continue;
>
> - uint64_t loc_mask = 1 << var->data.location;
> + uint64_t loc_mask = ((uint64_t)1) << var->data.location;
> if (var->data.patch) {
> if (deref_has_indirect(&b, var, intr->variables[0]))
> patch_indirects[var->data.location_frac] |=
> loc_mask;
> } else {
> if (deref_has_indirect(&b, var, intr->variables[0]))
> indirects[var->data.location_frac] |= loc_mask;
> }
> }
> }
> }
> @@ -282,21 +282,21 @@ lower_io_arrays_to_elements(nir_shader *shader,
> nir_variable_mode mask,
> if (intr->intrinsic != nir_intrinsic_load_var &&
> intr->intrinsic != nir_intrinsic_store_var &&
> intr->intrinsic != nir_intrinsic_interp_var_at_centroid
> &&
> intr->intrinsic != nir_intrinsic_interp_var_at_sample
> &&
> intr->intrinsic != nir_intrinsic_interp_var_at_offset)
> continue;
>
> nir_variable *var = intr->variables[0]->var;
>
> /* Skip indirects */
> - uint64_t loc_mask = 1 << var->data.location;
> + uint64_t loc_mask = ((uint64_t)1) << var->data.location;
> if (var->data.patch) {
> if (patch_indirects[var->data.location_frac] &
> loc_mask)
> continue;
> } else {
> if (indirects[var->data.location_frac] & loc_mask)
> continue;
> }
>
> nir_variable_mode mode = var->data.mode;
>
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171211/dbcb699b/attachment.html>
More information about the mesa-dev
mailing list