[Libva] [PATCH 10/13] VME shader keep for HEVC

Matt Turner mattst88 at gmail.com
Wed Jul 13 04:27:20 UTC 2016


On Tue, Jul 12, 2016 at 6:29 PM, Zhao Yakui <yakui.zhao at intel.com> wrote:
> On 07/12/2016 03:45 AM, Matt Turner wrote:
>>
>> On Thu, Jul 7, 2016 at 2:18 AM, Pengfei Qu<Pengfei.Qu at intel.com>  wrote:
>>>
>>> +/* Compare three word data to get the min value */
>>> +word_imin:
>>> +       cmp.le.f0.0 (1)         null:w          INPUT_ARG0.0<0,1,0>:w
>>> INPUT_ARG0.4<0,1,0>:w {align1};
>>> +       (f0.0) mov  (1)         TEMP_VAR0.0<1>:w INPUT_ARG0.0<0,1,0>:w
>>> {align1};
>>> +       (-f0.0) mov (1)         TEMP_VAR0.0<1>:w INPUT_ARG0.4<0,1,0>:w
>>> {align1};
>>> +       cmp.le.f0.0 (1)         null:w          TEMP_VAR0.0<0,1,0>:w
>>> INPUT_ARG0.8<0,1,0>:w {align1};
>>> +       (f0.0) mov  (1)         RET_ARG<1>:w TEMP_VAR0.0<0,1,0>:w
>>> {align1};
>>> +       (-f0.0) mov (1)         RET_ARG<1>:w INPUT_ARG0.8<0,1,0>:w
>>> {align1};
>>
>>
>> I think each of these groups of cmp/mov/mov can be replaced with a single
>> sel.
>
>
> Hi, Matt
>
>     Thanks for your suggestion.
>
>     The above cmp/mov/mov can't be replaced with one single sel. Only the
> two mov/mov can be replaced with one single sel as the condition of select
> instruction is based on cmp instruction.

In fact, since Sandybridge sel with conditional mod is supported and
used to implement min/max in a single instruction without writing the
flag register.

See the relevant code in the i965 driver:
https://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/dri/i965/brw_fs_builder.h#n377


More information about the Libva mailing list