This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Reload problems with only one base reg for "base + offset" addressing mode
redriver jiang <jiang.redriver@gmail.com> writes:
> Hi,
>
> You mean I should define insn like this:
>
> (define_insn "*iorqi3_imm"
> [(set (mem:QI (match_operand:HI 0 "register_operand" "b"))
> (ior:QI (mem:QI (match_operand:HI 1 "register_operand" "b")
> (mem:QI (plus: HI (match_operand:HI 2
> "register_operand" "f")
> (match_operand: 3 HI
> "immediate_operand" "K") ))))]
> ""
> "..."
> [( set_attr "length" "1" )])
>
> "b" for R16,R17,R18, and "f" for R18, "K" for immediate operand with
> range "0-127"?
Sort of, but you shouldn't write the PLUS in the insn. Instead, write a
new constraint which accepts either a R16, R17, or R18 plus an offset.
Also, write the insn with three alternatives, with the offset constraint
in each position.
Ian