[Mesa-dev] [Mesa-stable] [PATCH] i965/fs: Don't emit SEL instructions for type-converting MOVs.

Francisco Jerez currojerez at riseup.net
Fri Mar 24 07:06:25 UTC 2017


Samuel Iglesias Gonsálvez <siglesias at igalia.com> writes:

> On Thu, 2017-03-23 at 13:50 -0700, Matt Turner wrote:
>> SEL can only convert between a few integer types, which we basically
>> never do.
>> 
>> Fixes fs/vs-double-uniform-array-direct-indirect-non-uniform-control-
>> flow
>> Cc: mesa-stable at lists.freedesktop.org
>
> I sent a similar but wrong patch (taking only into account the type
> size) some time ago, but after discussing it with Curro, the solution
> was to fix it inside d2x pass. This is what this patch "i965/fs:
> generalize the legalization d2x pass" does.
>
> I am still working on improving that patch but I expect to have
> something soon. If you prefer to land this now, please add my R-b but
> you probably want to discuss it with Curro before:
>
> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
>

Samuel's d2x patch has the advantage that it will allow the SEL peephole
to replace control flow with SEL instructions even where there is a type
conversion.  That said this patch shouldn't hurt in mesa-stable in the
meantime if we remember to revert it in master when Samuel's patch
lands.  Patch is:

Acked-by: Francisco Jerez <currojerez at riseup.net>

> Sam
>
>> ---
>>  src/intel/compiler/brw_fs_sel_peephole.cpp | 2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/src/intel/compiler/brw_fs_sel_peephole.cpp
>> b/src/intel/compiler/brw_fs_sel_peephole.cpp
>> index 8cd897f..4c1c160 100644
>> --- a/src/intel/compiler/brw_fs_sel_peephole.cpp
>> +++ b/src/intel/compiler/brw_fs_sel_peephole.cpp
>> @@ -165,6 +165,8 @@ fs_visitor::opt_peephole_sel()
>>               then_mov[i]->exec_size != else_mov[i]->exec_size ||
>>               then_mov[i]->group != else_mov[i]->group ||
>>               then_mov[i]->force_writemask_all != else_mov[i]-
>> >force_writemask_all ||
>> +             then_mov[i]->dst.type != then_mov[i]->src[0].type ||
>> +             else_mov[i]->dst.type != else_mov[i]->src[0].type ||
>>               then_mov[i]->is_partial_write() ||
>>               else_mov[i]->is_partial_write() ||
>>               then_mov[i]->conditional_mod != BRW_CONDITIONAL_NONE ||
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170324/18d5a23d/attachment.sig>


More information about the mesa-dev mailing list