This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lno] [patch] vectorizer update - support constants.
- From: Dorit Naishlos <DORIT at il dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Daniel Jacobowitz <drow at mvista dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 26 Jan 2004 15:05:34 +0200
- Subject: Re: [lno] [patch] vectorizer update - support constants.
> This is a problem in the ppc machine description. According to
> ...
> that instruction is legal. To fix this, you need a more complex
> test instead of "TARGET_ALTIVEC".
Yes, that does the trick.
I'll send a patch shortly.
thanks very much,
dorit
Richard Henderson
<rth@redhat.com> To: Dorit Naishlos/Haifa/IBM@IBMIL
cc: Daniel Jacobowitz <drow@mvista.com>, gcc-patches@gcc.gnu.org
23/01/2004 00:11 Subject: Re: [lno] [patch] vectorizer update - support constants.
On Thu, Jan 22, 2004 at 11:58:45PM +0200, Dorit Naishlos wrote:
> The vectorizer actually generates the 0 initialization out of the loop,
but
> it is propagated into the store insn inside the loop during gcse:
>
> (insn 17 16 18 1 (set (mem:V8HI (plus:SI (reg:SI 124)
> (reg:SI 127)) [3 S16 A128])
> (const_vector:V8HI [
> (const_int 0 [0x0])
> (const_int 0 [0x0])
> (const_int 0 [0x0])
> (const_int 0 [0x0])
> (const_int 0 [0x0])
> (const_int 0 [0x0])
> (const_int 0 [0x0])
> (const_int 0 [0x0])
> ])) 561 {*movv8hi_internal1} (nil)
> (nil))
>
> ...and unfortunately remains in the loop from that point.
This is a problem in the ppc machine description. According to
[(set (match_operand:V8HI 0 "nonimmediate_operand" "=m,v,v,o,r,r,v")
(match_operand:V8HI 1 "input_operand" "v,m,v,r,o,r,W"))]
"TARGET_ALTIVEC"
that instruction is legal. To fix this, you need a more complex
test instead of "TARGET_ALTIVEC". Notice that movsi_internal1 uses
"gpc_reg_operand (operands[0], SImode)
|| gpc_reg_operand (operands[1], SImode)"
This is the correct type of test, though of course that exact test
would fail for vxx registers.
r~