This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: altivec: vector constant misc
- From: Dale Johannesen <dalej at apple dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Dale Johannesen <dalej at apple dot com>, Aldy Hernandez <aldyh at redhat dot com>, David Edelsohn <dje at watson dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Feb 2002 17:30:40 -0800
- Subject: Re: altivec: vector constant misc
On Friday, February 15, 2002, at 04:23 PM, Richard Henderson wrote:
> On Sat, Feb 16, 2002 at 09:40:24AM +1100, Aldy Hernandez wrote:
>> btw, i'm revising my patch to remove the (set (reg) (const_int 0))
>> pattern for vectors in favor of just emit_insn'ing the XOR
>> directly. duh.
>
> Not duh.
>
> (set (reg) (constant))
>
> has no dependencies on previous instructions and clearly
> kills the value in REG. On the other hand,
>
> (set (reg) (xor (reg) (reg)))
>
> apparently uses the original value in reg.
Another point is that there are several ways to generate simple
vector constants, for example 0 can be either VXOR R,R,R
or VSPLITISW R,0. This matters because they use different
functional units and can be scheduled "free" opposite other
instructions in some cases. The Motorola code looks at the
nearby instructions and tries to use a different FU for the
constant. It may be better to delay the choice until
scheduling time.