Discussion:
blkmov and alignment
Paul Koning
2018-10-05 14:17:53 UTC
Permalink
The documentation says that argument 4 of the blkmov insn gives the alignment, for example 4 if things are word-aligned.

It's documented that, say, the value 4 means source and destination are multiples of 4. What isn't clear is whether the length is also a multiple of 4 in this case. In other words, does "aligned" state the alignment of source and destination and length, or only of the addresses and the length may still be odd?

paul
Richard Biener
2018-10-05 16:21:53 UTC
Permalink
Post by Paul Koning
The documentation says that argument 4 of the blkmov insn gives the
alignment, for example 4 if things are word-aligned.
It's documented that, say, the value 4 means source and destination are
multiples of 4. What isn't clear is whether the length is also a
multiple of 4 in this case. In other words, does "aligned" state the
alignment of source and destination and length, or only of the
addresses and the length may still be odd?
It only applies to the address alignment but you may want to check out the expander.

Richard.
Post by Paul Koning
paul
Paul Koning
2018-10-05 17:31:01 UTC
Permalink
Post by Richard Biener
Post by Paul Koning
The documentation says that argument 4 of the blkmov insn gives the
alignment, for example 4 if things are word-aligned.
It's documented that, say, the value 4 means source and destination are
multiples of 4. What isn't clear is whether the length is also a
multiple of 4 in this case. In other words, does "aligned" state the
alignment of source and destination and length, or only of the
addresses and the length may still be odd?
It only applies to the address alignment but you may want to check out the expander.
You mean emit_block_move_via_loop in expr.c? That has a comment saying it would be nice to move units larger than QImode. Yes, and that's just what I was looking to do.

I suppose I could write an expander that produces a different insn when the size is also the correct multiple, including the conversion from byte count to word count. That seems like an obvious common optimization so having to do it in target code is a bit odd.

paul

Loading...