diff mbox

[rs6000] Fix V16QI vector splat for little endian

Message ID 1384900915.7386.6.camel@oc8801110288.ibm.com
State New
Headers show

Commit Message

Bill Schmidt Nov. 19, 2013, 10:41 p.m. UTC
Hi,

When possible, we translate VEC_PERM_EXPRs into vector splat operations.
A previous patch fixed this up for little endian, but there was an
oversight for V16QI mode.  This patch fixes that oversight.  This fixes
the failing test gcc.dg/torture/vshuf-v16qi.c.

Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu using
--with-cpu=power7 with no regressions.  Is this ok for trunk?

Thanks,
Bill


2013-11-19  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (altivec_expand_vec_perm_const): Adjust
	V16QI vector splat case for little endian.

Comments

David Edelsohn Nov. 19, 2013, 11:39 p.m. UTC | #1
On Tue, Nov 19, 2013 at 5:41 PM, Bill Schmidt
<wschmidt@linux.vnet.ibm.com> wrote:
> Hi,
>
> When possible, we translate VEC_PERM_EXPRs into vector splat operations.
> A previous patch fixed this up for little endian, but there was an
> oversight for V16QI mode.  This patch fixes that oversight.  This fixes
> the failing test gcc.dg/torture/vshuf-v16qi.c.
>
> Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu using
> --with-cpu=power7 with no regressions.  Is this ok for trunk?
>
> Thanks,
> Bill
>
>
> 2013-11-19  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
>
>         * config/rs6000/rs6000.c (altivec_expand_vec_perm_const): Adjust
>         V16QI vector splat case for little endian.

Okay.

Thanks, David
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 205002)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -29849,6 +29849,8 @@  altivec_expand_vec_perm_const (rtx operands[4])
 	  break;
       if (i == 16)
 	{
+          if (!BYTES_BIG_ENDIAN)
+            elt = 15 - elt;
 	  emit_insn (gen_altivec_vspltb (target, op0, GEN_INT (elt)));
 	  return true;
 	}