diff mbox

[rs6000] Fix vsx_concat_<mode> insns for little endian

Message ID 1381884427.6275.103.camel@gnopaine
State New
Headers show

Commit Message

Bill Schmidt Oct. 16, 2013, 12:47 a.m. UTC
Simple patch to reverse the order of the input operands when
concatenating for little endian code generation.  Bootstrapped and
tested on powerpc64-unknown-linux-gnu and powerpc64le-unknown-linux-gnu
with no regressions.  Fixes two tests in the testsuite for the latter.
Ok for trunk?

Thanks,
Bill


2013-10-15  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/vsx.md (vsx_concat_<mode>): Adjust output for LE.
	(vsx_concat_v2sf): Likewise.

Comments

David Edelsohn Oct. 16, 2013, 1:59 p.m. UTC | #1
On Tue, Oct 15, 2013 at 8:47 PM, Bill Schmidt
<wschmidt@linux.vnet.ibm.com> wrote:
> Simple patch to reverse the order of the input operands when
> concatenating for little endian code generation.  Bootstrapped and
> tested on powerpc64-unknown-linux-gnu and powerpc64le-unknown-linux-gnu
> with no regressions.  Fixes two tests in the testsuite for the latter.
> Ok for trunk?
>
> Thanks,
> Bill
>
>
> 2013-10-15  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
>
>         * config/rs6000/vsx.md (vsx_concat_<mode>): Adjust output for LE.
>         (vsx_concat_v2sf): Likewise.

Okay.

Thanks, David
diff mbox

Patch

Index: gcc/config/rs6000/vsx.md
===================================================================
--- gcc/config/rs6000/vsx.md	(revision 203508)
+++ gcc/config/rs6000/vsx.md	(working copy)
@@ -1194,7 +1194,12 @@ 
 	 (match_operand:<VS_scalar> 1 "vsx_register_operand" "ws,wa")
 	 (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")))]
   "VECTOR_MEM_VSX_P (<MODE>mode)"
-  "xxpermdi %x0,%x1,%x2,0"
+{
+  if (BYTES_BIG_ENDIAN)
+    return "xxpermdi %x0,%x1,%x2,0";
+  else
+    return "xxpermdi %x0,%x2,%x1,0";
+}
   [(set_attr "type" "vecperm")])
 
 ;; Special purpose concat using xxpermdi to glue two single precision values
@@ -1207,7 +1212,12 @@ 
 	  (match_operand:SF 2 "vsx_register_operand" "f,f")]
 	 UNSPEC_VSX_CONCAT))]
   "VECTOR_MEM_VSX_P (V2DFmode)"
-  "xxpermdi %x0,%x1,%x2,0"
+{
+  if (BYTES_BIG_ENDIAN)
+    return "xxpermdi %x0,%x1,%x2,0";
+  else
+    return "xxpermdi %x0,%x2,%x1,0";
+}
   [(set_attr "type" "vecperm")])
 
 ;; xxpermdi for little endian loads and stores.  We need several of