[Mesa-dev] [PATCH 4/4] glsl: Delete LRP_TO_ARITH lowering pass flag.

Kenneth Graunke kenneth at whitecape.org
Tue Feb 25 16:53:57 PST 2014


On 02/24/2014 09:55 AM, Ian Romanick wrote:
> On 02/23/2014 07:19 PM, Kenneth Graunke wrote:
>> Tt's kind of a trap---calling do_common_optimization() after
>> lower_instructions() may cause opt_algebraic() to reintroduce
>> ir_triop_lrp expressions that were lowered, effectively defeating the
>> point.  Because of this, nobody uses it.
>>
>> Cc: "10.1" <mesa-stable at lists.freedesktop.org>
>> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
>> ---
>>   src/glsl/ir_optimization.h      |  5 ++---
>>   src/glsl/lower_instructions.cpp | 10 ----------
>>   2 files changed, 2 insertions(+), 13 deletions(-)
>>
>> diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h
>> index 055d655..1777b84 100644
>> --- a/src/glsl/ir_optimization.h
>> +++ b/src/glsl/ir_optimization.h
>> @@ -36,9 +36,8 @@
>>   #define LOG_TO_LOG2        0x10
>>   #define MOD_TO_FRACT       0x20
>>   #define INT_DIV_TO_MUL_RCP 0x40
>> -#define LRP_TO_ARITH       0x80
>> -#define BITFIELD_INSERT_TO_BFM_BFI 0x100
>> -#define LDEXP_TO_ARITH     0x200
>> +#define BITFIELD_INSERT_TO_BFM_BFI 0x80
>> +#define LDEXP_TO_ARITH     0x100
>>
>>   /**
>>    * \see class lower_packing_builtins_visitor
>> diff --git a/src/glsl/lower_instructions.cpp
>> b/src/glsl/lower_instructions.cpp
>> index 44a6e80..9c5e7b3 100644
>> --- a/src/glsl/lower_instructions.cpp
>> +++ b/src/glsl/lower_instructions.cpp
>> @@ -38,7 +38,6 @@
>>    * - LOG_TO_LOG2
>>    * - MOD_TO_FRACT
>>    * - LDEXP_TO_ARITH
>> - * - LRP_TO_ARITH
>>    * - BITFIELD_INSERT_TO_BFM_BFI
>>    *
>>    * SUB_TO_ADD_NEG:
>> @@ -87,10 +86,6 @@
>>    * -------------
>>    * Converts ir_binop_ldexp to arithmetic and bit operations.
>>    *
>> - * LRP_TO_ARITH:
>> - * -------------
>> - * Converts ir_triop_lrp to (op0 * (1.0f - op2)) + (op1 * op2).
>> - *
>>    * BITFIELD_INSERT_TO_BFM_BFI:
>>    * ---------------------------
>>    * Breaks ir_quadop_bitfield_insert into ir_binop_bfm (bitfield
>> mask) and
>> @@ -499,11 +494,6 @@
>> lower_instructions_visitor::visit_leave(ir_expression *ir)
>>        pow_to_exp2(ir);
>>         break;
>>
>> -   case ir_triop_lrp:
>> -      if (lowering(LRP_TO_ARITH))
>> -     lrp_to_arith(ir);
> 
> Shouldn't the lrp_to_arith implementation also get removed?  This
> appears to be the only caller...
> 
>> -      break;
>> -
>>      case ir_quadop_bitfield_insert:
>>         if (lowering(BITFIELD_INSERT_TO_BFM_BFI))
>>            bitfield_insert_to_bfm_bfi(ir);
>>
> 

You're right of course.  I've fixed that for v2.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140225/d767d4a7/attachment.pgp>


More information about the mesa-dev mailing list