This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: "xordi3" pattern in arm.md
- To: Philip Blundell <philb at gnu dot org>
- Subject: Re: "xordi3" pattern in arm.md
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Wed, 16 May 2001 10:35:14 +0100
- cc: gcc at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Organization: ARM Ltd.
- Reply-To: Richard dot Earnshaw at arm dot com
> 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.