This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: pr52543
Kenneth Zadeck <zadeck@naturalbridge.com> writes:
> I think that the question is really bigger than finding the correct
> line to fix. The problem is, that this code assumes that machines do
> not have multiword moves or multiword shifts. My machine has both,
> and i assume that the avr and the neon have at least multiword moves
> (but i do not know about the shifts). And as life moves forward,
> more machines will have these.
>
> It seems like the right way to fix this is to somehow enhance the code
> at the beginning of decompose_multiword_subregs to ask which modes are
> not cheap to move or shift and then modify the second loop to never
> lower for those operations for those modes.
>
> The question is do i add 2 more target hooks (one for shifting and one
> for moves) or do i use the rtx_cost mechanism and split for anything
> over COSTS_N_INSNS (1) or some such?
Why not use REGISTER_MOVE_COST? You only care about hard registers, and
all that matters are moves between hard registers and pseudo-regs. So
if you find a hard register REG, and if
register_move_cost (GET_MODE (reg), REGNO_REG_CLASS (REGNO (REG)),
REGNO_REG_CLASS (REGNO (REG)))
== 2
then put the pseudo reg into non_decomposable_context. This would be in
find_decomposable_subregs.
Ian