public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, rs6000] Provide little-endian support for vmrgew and vmrgow
@ 2014-02-16 17:19 Bill Schmidt
  2014-02-16 22:05 ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Schmidt @ 2014-02-16 17:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc

Hi,

With -mcpu=power8, we see two test cases (gcc.dg/vect/slp-perm-2.c and
gcc.dg/vect/slp-perm-5.c) regress for powerpc64le-linux.  GCC makes use
of some new Power8 instructions (vmrgew and vmrgow) which need
adjustment for little endian targets.  As with merge-high and merge-low,
we need to reverse the order of the input vectors and reverse the use of
the "odd" and "even" instructions (since the change in element ordering
changes which elements are odd and which are even).

Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no
regressions.  The failing tests now run to completion.  Is this ok for
trunk?

Thanks,
Bill


2014-02-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/altivec.md (p8_vmrgew): Handle little endian
	targets.
	(p8_vmrgow): Likewise.



Index: gcc/config/rs6000/altivec.md
===================================================================
--- gcc/config/rs6000/altivec.md	(revision 207809)
+++ gcc/config/rs6000/altivec.md	(working copy)
@@ -1234,7 +1234,12 @@
 	  (parallel [(const_int 0) (const_int 4)
 		     (const_int 2) (const_int 6)])))]
   "TARGET_P8_VECTOR"
-  "vmrgew %0,%1,%2"
+{
+  if (BYTES_BIG_ENDIAN)
+    return "vmrgew %0,%1,%2";
+  else
+    return "vmrgow %0,%2,%1";
+}
   [(set_attr "type" "vecperm")])
 
 (define_insn "p8_vmrgow"
@@ -1246,7 +1251,12 @@
 	  (parallel [(const_int 1) (const_int 5)
 		     (const_int 3) (const_int 7)])))]
   "TARGET_P8_VECTOR"
-  "vmrgow %0,%1,%2"
+{
+  if (BYTES_BIG_ENDIAN)
+    return "vmrgow %0,%1,%2";
+  else
+    return "vmrgew %0,%2,%1";
+}
   [(set_attr "type" "vecperm")])
 
 (define_expand "vec_widen_umult_even_v16qi"


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, rs6000] Provide little-endian support for vmrgew and vmrgow
  2014-02-16 17:19 [PATCH, rs6000] Provide little-endian support for vmrgew and vmrgow Bill Schmidt
@ 2014-02-16 22:05 ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2014-02-16 22:05 UTC (permalink / raw)
  To: Bill Schmidt; +Cc: GCC Patches

On Sun, Feb 16, 2014 at 12:19 PM, Bill Schmidt
<wschmidt@linux.vnet.ibm.com> wrote:
> Hi,
>
> With -mcpu=power8, we see two test cases (gcc.dg/vect/slp-perm-2.c and
> gcc.dg/vect/slp-perm-5.c) regress for powerpc64le-linux.  GCC makes use
> of some new Power8 instructions (vmrgew and vmrgow) which need
> adjustment for little endian targets.  As with merge-high and merge-low,
> we need to reverse the order of the input vectors and reverse the use of
> the "odd" and "even" instructions (since the change in element ordering
> changes which elements are odd and which are even).
>
> Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no
> regressions.  The failing tests now run to completion.  Is this ok for
> trunk?
>
> Thanks,
> Bill
>
>
> 2014-02-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
>
>         * config/rs6000/altivec.md (p8_vmrgew): Handle little endian
>         targets.
>         (p8_vmrgow): Likewise.

Okay.

Thanks, David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-16 22:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-16 17:19 [PATCH, rs6000] Provide little-endian support for vmrgew and vmrgow Bill Schmidt
2014-02-16 22:05 ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).