On 3 March 2015 at 10:37, Brian Paul <bri...@vmware.com> wrote:
> On 03/02/2015 04:03 PM, Eric Anholt wrote:
>>
>> Kenneth Graunke <kenn...@whitecape.org> writes:
>>
>>> Generated by the following Coccinelle semantic patch:
>>>
>>> @@
>>> expression E;
>>> @@
>>> if (
>>> -E
>>> +unlikely(E)
>>>   )
>>> { ... _mesa_error(...) ... }
>>>
>>> Improves performance in OglBatch7 (a CPU-bound microbenchmark) on
>>> an i7 4750HQ (Haswell) by 1.08546% +/- 0.519734% (n=292).
>>>
>>> Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
>>
>>
>> Neat!
>>
>> I think you're supposed to be able to get the same result by marking
>> _mesa_error as attribute cold.  Then nobody can forget to mark their
>> conditions as unlikely in the future.
>
>
> I suspect unlikely() would be supported by more compilers than 'cold'.

why can't we just do _mesa_error -> __mesa_error, #define _mesa_error
unlikely(__mesa_error) or some such.

Sticking the unlikelys in every place seems like overkill, and
clutters the code up.

It also makes ripping this out later when cold works a lot easier.

Dave.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to