On 10/14/2018 03:58 PM, Jason Ekstrand wrote:
> On October 14, 2018 17:12:34 Matt Turner <matts...@gmail.com> wrote:
>> +static nir_ssa_def *
>> +lower_iabs64(nir_builder *b, nir_ssa_def *x)
>> +{
>> +   nir_ssa_def *x_hi = nir_unpack_64_2x32_split_y(b, x);
>> +   nir_ssa_def *x_is_neg = nir_ilt(b, x_hi, nir_imm_int(b, 0));
>> +   return nir_bcsel(b, x_is_neg, lower_ineg64(b, x), x);
> 
> lower_bcsel?  Or, since we're depending on this running multiple times,
> just nir_ineg?  I go back and forth on whether a pass like this should
> run in a loop or be smart enough to lower intermediate bits on the fly. 
> We should probably pick one.

In principle, I agree.  I've been bitten a couple times by lowering
passes that generate other things that need to be lowered on some
platforms (that I didn't test).  In this case, I think the loop is the
right answer since each operation is lowered by a separate flag.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to