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]

[PATCH, rs6000] Fix mulv8hi3 pattern for little endian


Hi,

The RTL generation for mulv8hi3 is slightly different for big and little
endian modes.  In the latter case, the operands of the vector-pack
instruction must be reversed to get the proper interleaving.

Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no new
regressions.  This fixes 3 test case failures for the little endian
target.  Is this ok for trunk?

Thanks,
Bill


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

	* config/rs6000/altivec.md (mulv8hi3): Adjust for little endian.


Index: gcc/config/rs6000/altivec.md
===================================================================
--- gcc/config/rs6000/altivec.md	(revision 203923)
+++ gcc/config/rs6000/altivec.md	(working copy)
@@ -681,7 +681,10 @@
    emit_insn (gen_altivec_vmrghw (high, even, odd));
    emit_insn (gen_altivec_vmrglw (low, even, odd));
 
-   emit_insn (gen_altivec_vpkuwum (operands[0], high, low));
+   if (BYTES_BIG_ENDIAN)
+     emit_insn (gen_altivec_vpkuwum (operands[0], high, low));
+   else
+     emit_insn (gen_altivec_vpkuwum (operands[0], low, high));
 
    DONE;
 }")



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