On 10/22/2012 08:39 PM, David Miller wrote:
> + /* Compare and Branch is limited to +-2KB. If it is too far away,
> + change
> +
> + cxbne X, Y, .LC30
> +
> + to
> +
> + cxbe X, Y, .+12
> + ba,pt xcc, .LC30
> + nop */
Based on your no-control-after cbcond comment at the top
of the patch, surely this should contain another nop as well.
> + *p++ = '\t';
> + *p++ = '%';
> + *p++ = '1';
> + *p++ = ',';
> + *p++ = ' ';
> + *p++ = '%';
> + *p++ = '2';
> + *p++ = ',';
> + *p++ = ' ';
And surely all this code isn't so performance sensitive that
it needs to be written in such an unreadable way.
p = stpcpy (p, "\t%1, %2, ");
is at least a little better.
Though really there's just 3 variable portions of the pattern, so
I wonder if a lesser number of snprintf calls might be good enough.
if (far)
{
if (veryfar)
snprintf (buf, sizeof(buf), "c%cb%s\t%%1, %%2, .+16\n\t"
"b\t%%l3\n\t nop", size_char, cond_str);
else
snprintf (buf, sizeof(buf), "c%cb%s\t%%1, %%2, .+16\n\t"
"ba,pt\t%%xcc,%%l3\n\t nop", size_char, cond_str);
}
else
snprintf (buf, sizeof(buf), "c%cb%s\t%%1, %%2, %%l3", size_char, cond_str);
r~