On mer., 2016-03-02 at 14:18 -0800, Tom Herbert wrote:
\
> + asm("lea 0f(, %[slen], 4), %%r11\n\t"
> + "clc\n\t"
> + "jmpq *%%r11\n\t"
> + "adcq 7*8(%[src]),%[res]\n\t"
> + "adcq 6*8(%[src]),%[res]\n\t"
> + "adcq 5*8(%[src]),%[res]\n\t"
> + "adcq 4*8(%[src]),%[res]\n\t"
> + "adcq 3*8(%[src]),%[res]\n\t"
> + "adcq 2*8(%[src]),%[res]\n\t"
> + "adcq 1*8(%[src]),%[res]\n\t"
> + "adcq 0*8(%[src]),%[res]\n\t"
> + "nop\n\t"
> + "0: adcq $0,%[res]"
> + : [res] "=r" (result)
> + : [src] "r" (buff),
> + [slen] "r" (-(unsigned long)(len >> 3)), "[res]" (result)
> + : "r11");
>
hpa mentioned we could use adcq.d8 0*8(%[src]),%[res]
to avoid the mandatory 'nop'