This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM] Allow TImode values in ARM core registers
> > > When support for the ARM Neon extension was committed, we
> > > accidentally prevented TImode values from residing in ARM core
> > > registers. This patch reverts that change.
> > >
> > I'm not convinced by this patch. Allowing TImode in core regs just
> > seems wrong. Especially when the comment immediately above says we
> > don't allow this,
>
> I wouldn't read too much into that comment (it was added at the same
> time as the "&& !VALID_NEON_STRUCT_MODE (mode)" part of the condition).
> The historical version of arm_hard_regno_mode_ok() definitely allowed
> TImode in core registers, rightly or wrongly. (The comment is
> definitely sensible for the structure modes which are even wider than
> TImode though).
Ah, I think I understand. Once we have a movti pattern the compiler expects to
be able to use it for all quadword values. movti has to accept core registers
for function arguments, which makes banning TImode in core registers a funny
choice.
I suspect we could get away with prohibiting all quadword values in core
registers. This would make the compiler error in a sensible way on the
suspect asm from the testcase. The ICE comes because we're allowing CDImode,
but not TImode. However I'm not certain this is safe so we'll go with your
approach.
I recommend changing replacing the original !VALID_NEON_STRUCT_MODE (mode)
with && ARM_NUM_REGS(mode) <= 4, and tweaking the preceding comment to
say "almost any value [...] Do not allow very large Neon[...]".
Ok with that change.
Paul