This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Porting GCC: understanding the meaning of predicates
- To: gcc at gcc dot gnu dot org, "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>, Joern Rennecke <amylaar at cygnus dot co dot uk>, Richard Hadsell <hadsell at blueskystudios dot com>
- Subject: Porting GCC: understanding the meaning of predicates
- From: Mueller-Lehnitz at t-online dot de (Anja Müller)
- Date: Sun, 13 Feb 2000 09:25:16 +0100
Hello,
I have some questions about the Predicate-Field in the RTL-Template of
an Instruction Pattern.
I have the following situation: The current instruction follows an
indirect addressing and the address of the memory operand stands in a
register.
Does this operand is valid for the predicate "general_operand" or
"register_operand" ? I does not think so, but I'm not sure, because a
"general_operand" can be a register operand (Value stands in a
register), a memory reference (operand is in memory) or an immediate
operand (a
constant). But when there is an indirect Operand, the address of this
operand can also be in a register, or it can be a memory reference or an
immediate operand. So if I define as predicate "register_operand", is a
valid operand really in a register or is it possible that only the
address of this
operand is in the register ?
There is another predicate "indirect_operand" for such cases. How can I
find out in the instruction pattern, where the address of the operand is
stored - in a register, in memory or as immediate value ? Can I do this
with the Constraints ? For example: when I want to have the address of
the
operand in one of my pointer registers - can I force this by the
Constraint-Letter that I defined for this Pointer-Register-Class ?
The data memory of my Target Machine cannot be addressed directly, that
means, that it is not possible to move a datum directly from memory to
a register or vice versa. The only way to do this is to load the memory
address of the datum into one of the pointer register at first. Then you
can
move the datum indirectly in the Accumulator (mov a,@dptr <-> mov
@dptr,a). How can I realize this in the "mov*"-Instruction Patterns ?
Ciao,
Anja