[Mesa-dev] [PATCH 06/10] nir: Add a bunch of algebraic optimizations on logic/bit operations.

Jason Ekstrand jason at jlekstrand.net
Thu Jan 22 10:24:43 PST 2015


On Thu, Jan 22, 2015 at 9:06 AM, Matt Turner <mattst88 at gmail.com> wrote:

> On Thu, Jan 22, 2015 at 7:27 AM, Jason Ekstrand <jason at jlekstrand.net>
> wrote:
> > On Jan 22, 2015 3:41 AM, "Kenneth Graunke" <kenneth at whitecape.org>
> wrote:
> >> diff --git a/src/glsl/nir/nir_opt_algebraic.py
> >> b/src/glsl/nir/nir_opt_algebraic.py
> >> index 169bb41..cf16b19 100644
> >> --- a/src/glsl/nir/nir_opt_algebraic.py
> >> +++ b/src/glsl/nir/nir_opt_algebraic.py
> >> @@ -68,6 +68,22 @@ optimizations = [
> >>     (('fadd', ('fmul', a, b), c), ('ffma', a, b, c)),
> >>     (('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),
> >>     (('fmin', ('fmax', a, 1.0), 0.0), ('fsat', a)),
> >> +   # Logical and bit operations
> >> +   (('fand', a, a), a),
> >
> > This isn't correct.  The fand operation will normalize to 0.0/1.0.
>
> I didn't understand why we had integer and float versions of bitwise
> operators before, but now I really don't understand what fand/for/fxor
> are for. What is their purpose? (Examples please)
>

They're for hardware that doesn't do integers.  That's not our hardware, so
we can really just ignore them for now.  I don't think our codegen can even
handle them.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150122/0abad096/attachment.html>


More information about the mesa-dev mailing list