diff mbox

[rs6000] Fix vect_pack_trunc_v2df pattern for little endian

Message ID 1383621694.6275.338.camel@gnopaine
State New
Headers show

Commit Message

Bill Schmidt Nov. 5, 2013, 3:21 a.m. UTC
Hi,

This fixes the two companion patterns vec_pack_[su]fix_trunc_v2df in the
same manner as the recent fix for vec_pack_trunc_v2df.  The same fix
obviously applies here as well.  Bootstrapped and tested on
powerpc64{,le}-unknown-linux-gnu with no regressions.  Is this ok for
trunk?

Thanks,
Bill


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

	* config/rs6000/vector.md (vec_pack_sfix_trunc_v2df): Adjust for
	little endian.
	(vec_pack_ufix_trunc_v2df): Likewise.

Comments

David Edelsohn Nov. 5, 2013, 3:51 a.m. UTC | #1
On Mon, Nov 4, 2013 at 10:21 PM, Bill Schmidt
<wschmidt@linux.vnet.ibm.com> wrote:
> Hi,
>
> This fixes the two companion patterns vec_pack_[su]fix_trunc_v2df in the
> same manner as the recent fix for vec_pack_trunc_v2df.  The same fix
> obviously applies here as well.  Bootstrapped and tested on
> powerpc64{,le}-unknown-linux-gnu with no regressions.  Is this ok for
> trunk?
>
> Thanks,
> Bill
>
>
> 2013-11-04  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
>
>         * config/rs6000/vector.md (vec_pack_sfix_trunc_v2df): Adjust for
>         little endian.
>         (vec_pack_ufix_trunc_v2df): Likewise.

This is okay.

Thanks, David
diff mbox

Patch

Index: gcc/config/rs6000/vector.md
===================================================================
--- gcc/config/rs6000/vector.md	(revision 204349)
+++ gcc/config/rs6000/vector.md	(working copy)
@@ -850,7 +850,12 @@ 
 
   emit_insn (gen_vsx_xvcvdpsxws (r1, operands[1]));
   emit_insn (gen_vsx_xvcvdpsxws (r2, operands[2]));
-  rs6000_expand_extract_even (operands[0], r1, r2);
+
+  if (BYTES_BIG_ENDIAN)
+    rs6000_expand_extract_even (operands[0], r1, r2);
+  else
+    rs6000_expand_extract_even (operands[0], r2, r1);
+
   DONE;
 })
 
@@ -865,7 +870,12 @@ 
 
   emit_insn (gen_vsx_xvcvdpuxws (r1, operands[1]));
   emit_insn (gen_vsx_xvcvdpuxws (r2, operands[2]));
-  rs6000_expand_extract_even (operands[0], r1, r2);
+
+  if (BYTES_BIG_ENDIAN)
+    rs6000_expand_extract_even (operands[0], r1, r2);
+  else
+    rs6000_expand_extract_even (operands[0], r2, r1);
+
   DONE;
 })