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

Zhao Yakui yakui.zhao at intel.com
Wed Jul 13 07:15:56 UTC 2016


On 07/13/2016 12:27 PM, Matt Turner wrote:
> 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.

Thanks for your input.
Sorry for my mistake. I checked the Sel Instruction again. Yes. It can 
be used to emulate the min/max instruction after the specific 
conditional modifier is added.

But it is not easier to understand.

At the same time as it is not critical to the performance and the 
current code can work well, I think that we can still keep the current code.

Anyway, thanks for your suggestion and input.
>
> 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