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

Matt Turner mattst88 at gmail.com
Mon Nov 27 19:42:53 UTC 2017


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171127/b8c126dd/attachment.sig>


More information about the mesa-dev mailing list