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

2017-11-27 Thread Pohjolainen, Topi
On Mon, Nov 27, 2017 at 11:42:53AM -0800, Matt Turner wrote:
> On 11/24, Topi Pohjolainen wrote:
> > Signed-off-by: Topi Pohjolainen 
> > ---
> > 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.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2017-11-27 Thread Matt Turner

On 11/24, Topi Pohjolainen wrote:

Signed-off-by: Topi Pohjolainen 
---
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.


signature.asc
Description: Digital signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2017-11-24 Thread Topi Pohjolainen
Signed-off-by: Topi Pohjolainen 
---
 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]];
   }
-- 
2.11.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev