"xordi3" pattern in arm.md
Richard Earnshaw
rearnsha@arm.com
Wed May 16 02:36:00 GMT 2001
> What purpose does this pattern serve? It just performs splitting, and a test
> case like the one below seems to produce rather better code without it.
>
> void g (unsigned long long);
> f(unsigned long long l)
> { g(l ^ 0x1000000010000000ULL); }
Right, but that constant is somewhat unusual in that both halves of it are
valid immediate ARM constants. Also remember that splitting the
operations up into subreg operations too early can limit the opportunities
for combine and the other optimizers to work well. Consider
long long x (long long y)
{
long long z = ~0LL;
return (y ^ z) + 1;
}
With the xordi3 pattern in, this compiles to
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, current_function_anonymous_args = 0
@ link register save eliminated.
rsbs r0, r0, #0
rsc r1, r1, #0
mov pc, lr
Without it, I suspect that we would miss the optimization altogether.
It might be worth creating a peephole2 pattern for this case.
R.
More information about the Gcc
mailing list