Thank you greatly for the feedback

I took at look at mips.md - and we already use the conditional "length" for some instruction.

However, some effective AVR instruction lengths are vastly complicated by operands, length and addressing modes. (After all we emulate 16 and 32 bit operations with only 8 bit CPU) . So it takes a relatively complex set of logic to get true length correct. This logic is already present as c functions. (move and shifts being the more complex variety). We call these routines only for final adjustment - but have to figure out which to call based on the insn RTL .

I fear that duplicating this logic in RTL patterns won't be very elegant or less error prone.

As I say above, the logic already exists as c function. If we could call these directly to determine the attribute value, it would be much easier!

For now, matching the name seems optimal.

Andy

Ian Lance Taylor wrote:
Andrew Hutchinson <[EMAIL PROTECTED]> writes:

The alternative, perhaps,  would be to set each length attribute
dynamically in each pattern - if that was possible. But that looks
like way more work.

That is certainly the best way.  Search for "length" in mips.md for
one example of how it can be done.

Ian

Reply via email to