[Mesa-dev] [PATCH] i965: Use ull immediates in brw_inst_bits
Iago Toral
itoral at igalia.com
Mon Nov 23 23:56:25 PST 2015
On Mon, 2015-11-23 at 14:03 -0800, Ian Romanick wrote:
> On 11/23/2015 02:01 PM, Ian Romanick wrote:
> > On 11/23/2015 10:54 AM, Jason Ekstrand wrote:
> >> This fixes a regression introduced in b1a83b5d1 that caused basically all
> >> shaders to fail to compile on 32-bit platforms.
> >
> > Here's the part from the b1a83b5d1 commit message that makes me sad:
> >
> > v2 (Iago)
> > - Replace ~0 by ~0ull
> > - Removed unnecessary parenthesis
Ugh, when Kristian proposed v3 I did not notice that he used ul instead
of ull... and of course piglit was fine because I have a 64-bit system.
Sorry about that :-(
Iago
> > This patch is
> >
> > Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>
> Also!
>
> Cc: "11.1" <mesa-stable at lists.freedesktop.org>
>
> >> Reported-by: Mark Janes <mark.a.janes at intel.com>
> >> Cc: Matt Turner <mattst88 at gmail.com>
> >> ---
> >> src/mesa/drivers/dri/i965/brw_inst.h | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/mesa/drivers/dri/i965/brw_inst.h b/src/mesa/drivers/dri/i965/brw_inst.h
> >> index b2afe17..cd9f6ef 100644
> >> --- a/src/mesa/drivers/dri/i965/brw_inst.h
> >> +++ b/src/mesa/drivers/dri/i965/brw_inst.h
> >> @@ -694,7 +694,7 @@ brw_inst_bits(const brw_inst *inst, unsigned high, unsigned low)
> >> high %= 64;
> >> low %= 64;
> >>
> >> - const uint64_t mask = (~0ul >> (64 - (high - low + 1)));
> >> + const uint64_t mask = (~0ull >> (64 - (high - low + 1)));
> >>
> >> return (inst->data[word] >> low) & mask;
> >> }
> >> @@ -713,7 +713,7 @@ brw_inst_set_bits(brw_inst *inst, unsigned high, unsigned low, uint64_t value)
> >> high %= 64;
> >> low %= 64;
> >>
> >> - const uint64_t mask = (~0ul >> (64 - (high - low + 1))) << low;
> >> + const uint64_t mask = (~0ull >> (64 - (high - low + 1))) << low;
> >>
> >> /* Make sure the supplied value actually fits in the given bitfield. */
> >> assert((value & (mask >> low)) == value);
> >>
> >
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list