bzero optimization rarely does
Paul Koning
pkoning@equallogic.com
Fri Jul 12 10:53:00 GMT 2002
>>>>> "Roger" == Roger Sayle <roger@eyesopen.com> writes:
Roger> I've tracked down the source of the problem. MOVE_BY_PIECES_P
Roger> and thereby MOVE_RATIO is being inappropriately used to
Roger> determine whether to call clear_by_pieces. On targets that
Roger> have movstr?i instructions MOVE_RATIO is set very low, so that
Roger> individual moves are discouraged in favour of a hardware block
Roger> move instruction. Alas on targets, like MIPS, that have a
Roger> movstr?i pattern but no clrstr?i, the use of clear_by_pieces
Roger> is penalized in the hopes of using an efficient instruction
Roger> that doesn't exist. Similarly, targets with clrstr?i but no
Roger> movstr?i will generate long sequences of move instructions
Roger> rather than a hardware clear instruction.
Great. That all make sense; I was slowly approaching the same
conclusion but without being able to propose a fix for it.
MIPS doesn't have a block-move instruction, but it does have a way to
do bulk moves that's more efficient than the load<mode>, store<mode>
you get without the movstr pattern. The same would seem to be true
for clear, so I suspect that adding a clrstr<xx> pattern to mips.md
would be an additional useful thing to do. But at least, in the
meantime, what you're doing should help a lot.
paul
More information about the Gcc
mailing list