[Mesa-dev] [PATCH 2/3] i965/fs/nir: Optimize (gl_FrontFacing ? x : y) where x and y are ±1.0.

2015-02-17 Thread Matt Turner
total instructions in shared programs: 8013221 -> 8010869 (-0.03%) instructions in affected programs: 475925 -> 473573 (-0.49%) helped:2350 --- src/mesa/drivers/dri/i965/brw_fs.h | 3 ++ src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 81 ++

Re: [Mesa-dev] [PATCH 2/3] i965/fs/nir: Optimize (gl_FrontFacing ? x : y) where x and y are ±1.0.

2015-02-19 Thread Matt Turner
On Tue, Feb 17, 2015 at 11:46 AM, Matt Turner wrote: > total instructions in shared programs: 8013221 -> 8010869 (-0.03%) > instructions in affected programs: 475925 -> 473573 (-0.49%) > helped:2350 > --- Patches 1 and 3 have been reviewed, but I'm this one has

Re: [Mesa-dev] [PATCH 2/3] i965/fs/nir: Optimize (gl_FrontFacing ? x : y) where x and y are ±1.0.

2015-02-20 Thread Eric Anholt
I wanted patch #1 to land, so I took a look at this one :) Matt Turner writes: > + if (brw->gen >= 6) { > + /* Bit 15 of g0.0 is 0 if the polygon is front facing. */ > + fs_reg g0 = fs_reg(retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_W)); > + > + /* For (gl_FrontFacing ? 1.0 : -1

Re: [Mesa-dev] [PATCH 2/3] i965/fs/nir: Optimize (gl_FrontFacing ? x : y) where x and y are ±1.0.

2015-02-20 Thread Matt Turner
On Fri, Feb 20, 2015 at 11:54 AM, Eric Anholt wrote: > I wanted patch #1 to land, so I took a look at this one :) Thanks! :) > Matt Turner writes: >> + if (brw->gen >= 6) { >> + /* Bit 15 of g0.0 is 0 if the polygon is front facing. */ >> + fs_reg g0 = fs_reg(retype(brw_vec1_grf(0,

Re: [Mesa-dev] [PATCH 2/3] i965/fs/nir: Optimize (gl_FrontFacing ? x : y) where x and y are ±1.0.

2015-02-20 Thread Eric Anholt
Matt Turner writes: > On Fri, Feb 20, 2015 at 11:54 AM, Eric Anholt wrote: >> I wanted patch #1 to land, so I took a look at this one :) > > Thanks! :) > >> Matt Turner writes: >>> + if (brw->gen >= 6) { >>> + /* Bit 15 of g0.0 is 0 if the polygon is front facing. */ >>> + fs_reg g0

Re: [Mesa-dev] [PATCH 2/3] i965/fs/nir: Optimize (gl_FrontFacing ? x : y) where x and y are ±1.0.

2015-02-20 Thread Matt Turner
On Fri, Feb 20, 2015 at 1:41 PM, Eric Anholt wrote: >> Or maybe I'm just wrong and some bit is guaranteed to be set? > > A "This negation looks like it's safe in practice, because bits 0:4 will > surely be TRIANGLES" comment seems fine with me. Thanks, will do. R-b? I realized I was looking at V

Re: [Mesa-dev] [PATCH 2/3] i965/fs/nir: Optimize (gl_FrontFacing ? x : y) where x and y are ±1.0.

2015-02-21 Thread Eric Anholt
Matt Turner writes: > On Fri, Feb 20, 2015 at 1:41 PM, Eric Anholt wrote: >>> Or maybe I'm just wrong and some bit is guaranteed to be set? >> >> A "This negation looks like it's safe in practice, because bits 0:4 will >> surely be TRIANGLES" comment seems fine with me. > > Thanks, will do. R-b?