RX: 4.5 branch: Fix alignment and addressing issues.
Nick Clifton
nickc@redhat.com
Thu Mar 17 12:30:00 GMT 2011
Hi Andrew,
>> + (set_attr "length" "5")] ;; Worst case sceanario. FIXME: If we defined separate patterns
>> +) ;; rather than using iterators we could specify exact sizes.
>
> You can set up the correct length even without using separate patterns.
The problem is that the lengths depend upon an *two* iterators and the
MEM involved as well. For example:
(define_insn "*comparesi3_<extend_types:code><small_int_modes:mode>"
[(set (reg:CC CC_REG)
(compare:CC (match_operand:SI
0 "register_operand" "=r")
(extend_types:SI (match_operand:small_int_modes
1 "rx_restricted_mem_operand" "Q"))))]
""
"cmp\t%<extend_types:letter>1, %0"
[(set_attr "timings" "33")
(set_attr "length" "5")] ;; Worst case sceanario. FIXME:
This insn is 2 bytes long if operand[1] is just MEM (REG) (ie no offset)
*and* the extend_types is zero-extend. It is 3 bytes long if
operands[1] is MEM (REG) and the extend_types is sign-extend. It is
also 3 bytes long if operands[1] is MEM (REG+INT) and the INT is < 256
(for QImode extensions) or less than (256 * 2) for HImode extensions and
the extend type is zero-extend. It is 4 bytes long if ... [snip - you
get the idea].
So really I think that I should be defining the ADJUST_INSN_LENGTH macro
to handle these patterns. I'll look into that.
Cheers
Nick
More information about the Gcc-patches
mailing list