This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Different multiply operator for pointers and integers
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Richard Earnshaw'" <rearnsha at gcc dot gnu dot org>,"'Laura Tosoratto'" <Laura dot Tosoratto at roma1 dot infn dot it>
- Cc: <gcc at gcc dot gnu dot org>,"'Alessandro Lonardo'" <alessandro dot lonardo at roma1 dot infn dot it>
- Date: Thu, 16 Dec 2004 16:45:18 -0000
- Subject: RE: Different multiply operator for pointers and integers
> -----Original Message-----
> From: gcc-owner On Behalf Of Richard Earnshaw
> Sent: 16 December 2004 16:40
> On Thu, 2004-12-16 at 16:32, Laura Tosoratto wrote:
> > In the same time, it needs all addresses to be hold in a
> specific part
> > of register file (we defined a reg_class to represent this
> set of regs) .
> You just need to provide multiple alternatives to the
> standard multiply operator.
>
> If your two register classes are matched by the constraint letters 'x'
> and 'y' respectively, then you just need a pattern something like
>
> (define_insn "muldi"
> [(set (match_operand:DI 0 "register_operand" "=x,y")
> (mult:DI (match_operand:DI 1 "register_operand" "%x,y")
> (match_operand:DI 2 "register_operand" "x,y")))]
> ""
> "@
> mult_fmt1 %0, %1, %2
> mult_fmt2 %0, %1, %2")
>
Doesn't that assume that the registers that hold pointers can _only_ be used
for pointers and not for integers? It doesn't necessarily follow from Laura's
original description that those registers _can't_ hold integers, only that
pointers _must_ be in one of them.
cheers,
DaveK
--
Can't think of a witty .sigline today....