Re: [Mesa-dev] [PATCH 3/3] intel/compiler: add an optimization pass for booleans

2018-07-05 Thread Iago Toral
On Thu, 2018-07-05 at 15:47 -0700, Caio Marcelo de Oliveira Filho wrote: > (I had to stop reading to go home last Tuesday, so here are the > remaining comments.) > > > On Tue, May 15, 2018 at 01:05:21PM +0200, Iago Toral Quiroga wrote: > > NIR assumes that all booleans are 32-bit but Intel hardwa

Re: [Mesa-dev] [PATCH 3/3] intel/compiler: add an optimization pass for booleans

2018-07-05 Thread Caio Marcelo de Oliveira Filho
(I had to stop reading to go home last Tuesday, so here are the remaining comments.) On Tue, May 15, 2018 at 01:05:21PM +0200, Iago Toral Quiroga wrote: > NIR assumes that all booleans are 32-bit but Intel hardware produces > booleans of the same size as the operands to the CMP instruction, so we

Re: [Mesa-dev] [PATCH 3/3] intel/compiler: add an optimization pass for booleans

2018-07-04 Thread Iago Toral
On Tue, 2018-07-03 at 18:45 -0700, Caio Marcelo de Oliveira Filho wrote: > Hi, > > > > + /* Look for any follow-up instructions that sources from the > > boolean > > +* result of the producer instruction and rewrite them to use > > the correct > > +* bit-size. > > +*/ > > + foreac

Re: [Mesa-dev] [PATCH 3/3] intel/compiler: add an optimization pass for booleans

2018-07-03 Thread Caio Marcelo de Oliveira Filho
Hi, > + /* Look for any follow-up instructions that sources from the boolean > +* result of the producer instruction and rewrite them to use the correct > +* bit-size. > +*/ > + foreach_inst_in_block_starting_from(fs_inst, fixup_inst, inst) { > + if (!inst_supports_boolean(fi

[Mesa-dev] [PATCH 3/3] intel/compiler: add an optimization pass for booleans

2018-05-15 Thread Iago Toral Quiroga
NIR assumes that all booleans are 32-bit but Intel hardware produces booleans of the same size as the operands to the CMP instruction, so we can actually have 8-bit and 16-bit booleans. To work around this mismatch between NIR and the hardware, we emit boolean conversions to 32-bit right after emit