On Sat, Feb 22, 2014 at 9:22 AM, Pohjolainen, Topi
<topi.pohjolai...@intel.com> wrote:
> On Thu, Feb 20, 2014 at 01:41:25PM -0800, Matt Turner wrote:
>>  void
>> -fs_visitor::emit_lrp(fs_reg dst, fs_reg x, fs_reg y, fs_reg a)
>> +fs_visitor::emit_lrp(const fs_reg &dst, const fs_reg &x, const fs_reg &y,
>> +                     const fs_reg &a)
>>  {
>>     if (brw->gen < 6 ||
>>         !x.is_valid_3src() ||
>> @@ -225,8 +226,9 @@ fs_visitor::emit_lrp(fs_reg dst, fs_reg x, fs_reg y, 
>> fs_reg a)
>>
>>        emit(MUL(y_times_a, y, a));
>>
>> -      a.negate = !a.negate;
>> -      emit(ADD(one_minus_a, a, fs_reg(1.0f)));
>> +      fs_reg negative_a = a;
>> +      negative_a.negate = !a.negate;
>> +      emit(ADD(one_minus_a, negative_a, fs_reg(1.0f)));
>
> If you left the type of 'a' intact this change wouldn't be needed. But I don't
> have preference whether letting the compiler to emit the copy or doing it
> manually here.

Right, thanks for the comments. I did it this way so that in the case
we can emit a LRP instruction, we didn't have to make a copy. We have
to make one for this branch regardless, but it helps the other case.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to