This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Try to avoid vector mode punning in SET_DEST on i?86


On Mon, Nov 04, 2013 at 06:23:19PM +0000, James Greenhalgh wrote:
> > --- gcc/optabs.c.jj     2013-10-29 09:25:45.000000000 +0100
> > +++ gcc/optabs.c        2013-10-31 13:20:40.384808642 +0100
> > @@ -6674,7 +6674,7 @@ expand_vec_perm (enum machine_mode mode,
> >         }
> >        tmp = gen_rtx_CONST_VECTOR (qimode, vec);
> >        sel = gen_lowpart (qimode, sel);
> > -      sel = expand_vec_perm (qimode, sel, sel, tmp, NULL);
> > +      sel = expand_vec_perm (qimode, gen_reg_rtx (qimode), sel, tmp, NULL);
> >        gcc_assert (sel != NULL);
> > 
> >        /* Add the byte offset to each byte element.  */
> 
> This hunk causes issues on AArch64 and ARM.
> 
> We look to see which permute operation we should generate in
> aarch64_expand_vec_perm_const. If we notice that all elements in 
> would select from op0 we copy op0 to op1 and generate appropriate code.

Sorry for that, I've missed that expand_vec_perm has very different
argument order than expand_vec_perm_1 (the former has target last,
the latter second after icode), so misread the code as assigning to sel
when it in fact does a single argument permutation into NULL target.
Apparently this code isn't used on x86_64/i686 at all, so my
bootstrap/regtest has not detected it.

I've reverted that one liner now:
--- ChangeLog	(revision 204357)
+++ ChangeLog	(working copy)
@@ -1,5 +1,8 @@
 2013-11-04  Jakub Jelinek  <jakub@redhat.com>
 
+	* optabs.c (expand_vec_perm): Revert one incorrect line from
+	2013-10-31 change.
+
 	PR tree-optimization/58978
 	* tree-vrp.c (all_imm_uses_in_stmt_or_feed_cond): Don't modify
 	use_stmt by single_imm_use directly.  Only call single_imm_use
--- optabs.c	(revision 204356)
+++ optabs.c	(working copy)
@@ -6674,7 +6674,7 @@ expand_vec_perm (enum machine_mode mode,
 	}
       tmp = gen_rtx_CONST_VECTOR (qimode, vec);
       sel = gen_lowpart (qimode, sel);
-      sel = expand_vec_perm (qimode, gen_reg_rtx (qimode), sel, tmp, NULL);
+      sel = expand_vec_perm (qimode, sel, sel, tmp, NULL);
       gcc_assert (sel != NULL);
 
       /* Add the byte offset to each byte element.  */

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]