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

Matt Turner mattst88 at gmail.com
Thu Jan 22 09:06:47 PST 2015


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)


More information about the mesa-dev mailing list