[Mesa-dev] [PATCH 01/51] nir: Prepare constant folding for 16-bits

Pohjolainen, Topi topi.pohjolainen at gmail.com
Mon Nov 27 18:43:34 UTC 2017


On Mon, Nov 27, 2017 at 11:42:53AM -0800, Matt Turner wrote:
> On 11/24, Topi Pohjolainen wrote:
> > Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> > ---
> > src/compiler/nir/nir_opt_constant_folding.c | 2 ++
> > 1 file changed, 2 insertions(+)
> > 
> > diff --git a/src/compiler/nir/nir_opt_constant_folding.c b/src/compiler/nir/nir_opt_constant_folding.c
> > index d6be807b3d..b63660ea4d 100644
> > --- a/src/compiler/nir/nir_opt_constant_folding.c
> > +++ b/src/compiler/nir/nir_opt_constant_folding.c
> > @@ -78,6 +78,8 @@ constant_fold_alu_instr(nir_alu_instr *instr, void *mem_ctx)
> >            j++) {
> >          if (load_const->def.bit_size == 64)
> >             src[i].u64[j] = load_const->value.u64[instr->src[i].swizzle[j]];
> > +         else if (load_const->def.bit_size == 16)
> > +            src[i].u16[j] = load_const->value.u16[instr->src[i].swizzle[j]];
> >          else
> >             src[i].u32[j] = load_const->value.u32[instr->src[i].swizzle[j]];
> 
> I dislike that we handle 64-bit, 16-bit, and 32-bit in that order, but
> it's not a big deal.

Ah, right. I tried to keep the diff as small as possible and didn't pay
attention to what the code looks like. I agree.


More information about the mesa-dev mailing list