This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Porting the GCC: order of registers
- To: gcc at gcc dot gnu dot org
- Subject: Porting the GCC: order of registers
- From: Mueller-Lehnitz at t-online dot de (Anja Müller)
- Date: Sat, 29 Jan 2000 19:01:00 +0100
Hello,
I want to port the gcc to the microcontroller 8051 and now write the
machine description. There are some questions about register allocation,
I want to ask you.
How can I tell the GCC the order of registers ? I need to know this for
special operation of the microcontroller: the 8051 ist a
8-Bit-Microcontroller, that means that alle Registers have 8 Bit. But
the 8051 has a Multiply-Operation that multiplies the Akkumulator
Register A and another Register B and writes the 16-Bit-Result into A
and B, especially the low-Byte into register A and the high-Byte into
Register B. So I want to define the named Instruction Pattern "mulqihi3"
to make this operation avaiable to the GCC:
(define_insn "mulqihi3"
[(set (match_operand:HI 0 "register_operand" "=a")
(mult:HI (match_operand:QI 1 "register_operand" "%0")
(match_operand:QI 2 "register_operand" "b")))]
""
"@
...
a = register constraint to point at register A
b = register constraint to point at register B
But how does the GCC know that the higher part of the result is stored
in register B ? When I defined the Macros FIXED_REGISTERS,
CALL_USED_REGISTER, ... registers B is not the next one to register A,
there are some other registers betweem them because the operation on
these registers are faster, so they shall be allocated by the GCC
earlier then regsiter B and the following. My Question is: which macro
defines the order of register when more than one register is needed to
store a value, for example a 16-Bit-Value in two 8-Bit-register ?
Bye, Anja