nir: fix shift for uint64_t
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 12 Dec 2017 02:52:50 +0000 (13:52 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 13 Dec 2017 02:20:28 +0000 (13:20 +1100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/nir/nir_lower_io_arrays_to_elements.c

index dca5719f11493111ed056bd01c85418d7096365c..cdf9a76a881edf6bb8e36495d9a89af0c7d1b794 100644 (file)
@@ -247,7 +247,7 @@ create_indirects_mask(nir_shader *shader, uint64_t *indirects,
                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;
@@ -289,7 +289,7 @@ lower_io_arrays_to_elements(nir_shader *shader, nir_variable_mode mask,
                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;