This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Make a register pair for use in divmodm4


Hi. I'm writing a pattern for "udivmodsi4" using the RTL template like
this:

[(set (match_operand:SI 0 "register_operand" "=r")
      (udiv:SI (match_operand:SI 1 "register_operand" "r")
               (match_operand:SI 2 "register_operand" "r")))
 (set (match_operand:SI 3 "register_operand" "=r")
      (umod:SI (match_dup 1)
               (match_dup 2)))]

The architecture has an instruction for doing this with three operands
that can be specified, op0-op2 in the template, and one implisit, op3 in
the template.

The instruction is doing:
rd   <-- rx / ry;
rd+1 <-- rx % ry;

All operands have to be a register.

How can I tell the compiler that op3 has to be the next register after
op0. (REGNO(op3) == (REGNO(op0)+1)

Anders


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]