x86_64 varargs setup jump table

H.J. Lu hjl.tools@gmail.com
Mon Jul 19 20:57:00 GMT 2010


On Mon, Jul 19, 2010 at 8:56 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Jul 19, 2010 at 8:41 AM, Richard Henderson <rth@redhat.com> wrote:
>> On 07/17/2010 07:25 AM, Bernd Schmidt wrote:
>>>       leaq    0(,%rax,4), %rcx
>>>       movl    $.L2, %eax
>>>       subq    %rcx, %rax
>>>       jmp     *%rax
>>
>> I've often thought this was over-engineering in the x86_64 abi.
>> This jump table is trading memory bandwidth for unpredictability
>> in the branch target.
>>
>> I've often wondered if we'd get better performance if we changed
>> to a simple comparison against zero.  I.e.
>>
>>        test    %al,%al
>>        jz      1f
>>        // 8 xmm stores
>> 1:
>>
>> H.J., do you think you'd be able to measure performance on this?
>>
>
> Sure.

Just to be clear.  I can test performance impact if there is a patch.
But I don't have time to create a patch in the near future.


-- 
H.J.



More information about the Gcc-patches mailing list