Commit 3ca588d3 by Maciej W. Rozycki Committed by Maciej W. Rozycki

rs6000.c (output_vec_const_move): Handle little-endian code generation.

	gcc/
	* config/rs6000/rs6000.c (output_vec_const_move): Handle
	little-endian code generation.
	* config/rs6000/spe.md (spe_evmergehi): Rename to...
	(vec_perm00_v2si): ... this.  Handle little-endian code 
	generation.
	(spe_evmergehilo): Rename to...
	(vec_perm01_v2si): ... this.  Handle little-endian code
	generation.
	(spe_evmergelo): Rename to...
	(vec_perm11_v2si): ... this.  Handle little-endian code
	generation.
	(spe_evmergelohi): Rename to...
	(vec_perm10_v2si): ... this.  Handle little-endian code
	generation.
	(spe_evmergehi, spe_evmergehilo): New expanders.
	(spe_evmergelo, spe_evmergelohi): Likewise.
	(*frob_<SPE64:mode>_<DITI:mode>): Handle little-endian code
	generation.
	(*frob_tf_ti): Likewise.
	(*frob_<mode>_di_2): Likewise.
	(*frob_tf_di_8_2): Likewise.
	(*frob_di_<mode>): Likewise.
	(*frob_ti_tf): Likewise.
	(*frob_<DITI:mode>_<SPE64:mode>_2): Likewise.
	(*frob_ti_<mode>_8_2): Likewise.
	(*frob_ti_tf_2): Likewise.
	(mov_si<mode>_e500_subreg0): Rename to...
	(mov_si<mode>_e500_subreg0_be): ... this.  Restrict to the big
	endianness only.
	(*mov_si<mode>_e500_subreg0_le): New instruction pattern.
	(*mov_si<mode>_e500_subreg0_elf_low): Rename to...
	(*mov_si<mode>_e500_subreg0_elf_low_be): ... this.  Restrict to 
	the big endianness only.
	(*mov_si<mode>_e500_subreg0_elf_low_le): New instruction pattern.
	(*mov_si<mode>_e500_subreg0_2): Rename to...
	(*mov_si<mode>_e500_subreg0_2_be): ... this.  Restrict to the
	big big endianness only.
	(*mov_si<mode>_e500_subreg0_2_le): New instruction pattern.
	(*mov_si<mode>_e500_subreg4): Rename to...
	(*mov_si<mode>_e500_subreg4_be): ... this.  Restrict to the big
	endianness only.
	(mov_si<mode>_e500_subreg4_le): New instruction pattern.
	(*mov_si<mode>_e500_subreg4_elf_low): Rename to...
	(*mov_si<mode>_e500_subreg4_elf_low_be): ... this.  Restrict to
	the big endianness only.
	(*mov_si<mode>_e500_subreg4_elf_low_le): New instruction/splitter
	pattern.
	(*mov_si<mode>_e500_subreg4_2): Rename to...
	(*mov_si<mode>_e500_subreg4_2_be): ... this.  Restrict to the big
	endianness only.
	(*mov_si<mode>_e500_subreg4_2_le): New instruction pattern.
	(*mov_sitf_e500_subreg8): Rename to...
	(*mov_sitf_e500_subreg8_be): ... this.  Restrict to the big
	endianness only.
	(*mov_sitf_e500_subreg8_le): New instruction pattern.
	(*mov_sitf_e500_subreg8_2): Rename to...
	(*mov_sitf_e500_subreg8_2_be): ... this.  Restrict to the big
	endianness only.
	(*mov_sitf_e500_subreg8_2_le): New instruction pattern.
	(*mov_sitf_e500_subreg12): Rename to...
	(*mov_sitf_e500_subreg12_be): ... this.  Restrict to the big
	endianness only.
	(*mov_sitf_e500_subreg12_le): New instruction pattern.
	(*mov_sitf_e500_subreg12_2): Rename to...
	(*mov_sitf_e500_subreg12_2_be): ... this.  Restrict to the big
	endianness only.
	(*mov_sitf_e500_subreg12_2_le): New instruction pattern.

	gcc/testsuite/
	* gcc.target/powerpc/spe-evmerge.c: New file.

From-SVN: r212335
parent e7623929
2014-07-07 Maciej W. Rozycki <macro@codesourcery.com>
* config/rs6000/rs6000.c (output_vec_const_move): Handle
little-endian code generation.
* config/rs6000/spe.md (spe_evmergehi): Rename to...
(vec_perm00_v2si): ... this. Handle little-endian code
generation.
(spe_evmergehilo): Rename to...
(vec_perm01_v2si): ... this. Handle little-endian code
generation.
(spe_evmergelo): Rename to...
(vec_perm11_v2si): ... this. Handle little-endian code
generation.
(spe_evmergelohi): Rename to...
(vec_perm10_v2si): ... this. Handle little-endian code
generation.
(spe_evmergehi, spe_evmergehilo): New expanders.
(spe_evmergelo, spe_evmergelohi): Likewise.
(*frob_<SPE64:mode>_<DITI:mode>): Handle little-endian code
generation.
(*frob_tf_ti): Likewise.
(*frob_<mode>_di_2): Likewise.
(*frob_tf_di_8_2): Likewise.
(*frob_di_<mode>): Likewise.
(*frob_ti_tf): Likewise.
(*frob_<DITI:mode>_<SPE64:mode>_2): Likewise.
(*frob_ti_<mode>_8_2): Likewise.
(*frob_ti_tf_2): Likewise.
(mov_si<mode>_e500_subreg0): Rename to...
(mov_si<mode>_e500_subreg0_be): ... this. Restrict to the big
endianness only.
(*mov_si<mode>_e500_subreg0_le): New instruction pattern.
(*mov_si<mode>_e500_subreg0_elf_low): Rename to...
(*mov_si<mode>_e500_subreg0_elf_low_be): ... this. Restrict to
the big endianness only.
(*mov_si<mode>_e500_subreg0_elf_low_le): New instruction pattern.
(*mov_si<mode>_e500_subreg0_2): Rename to...
(*mov_si<mode>_e500_subreg0_2_be): ... this. Restrict to the
big big endianness only.
(*mov_si<mode>_e500_subreg0_2_le): New instruction pattern.
(*mov_si<mode>_e500_subreg4): Rename to...
(*mov_si<mode>_e500_subreg4_be): ... this. Restrict to the big
endianness only.
(mov_si<mode>_e500_subreg4_le): New instruction pattern.
(*mov_si<mode>_e500_subreg4_elf_low): Rename to...
(*mov_si<mode>_e500_subreg4_elf_low_be): ... this. Restrict to
the big endianness only.
(*mov_si<mode>_e500_subreg4_elf_low_le): New instruction/splitter
pattern.
(*mov_si<mode>_e500_subreg4_2): Rename to...
(*mov_si<mode>_e500_subreg4_2_be): ... this. Restrict to the big
endianness only.
(*mov_si<mode>_e500_subreg4_2_le): New instruction pattern.
(*mov_sitf_e500_subreg8): Rename to...
(*mov_sitf_e500_subreg8_be): ... this. Restrict to the big
endianness only.
(*mov_sitf_e500_subreg8_le): New instruction pattern.
(*mov_sitf_e500_subreg8_2): Rename to...
(*mov_sitf_e500_subreg8_2_be): ... this. Restrict to the big
endianness only.
(*mov_sitf_e500_subreg8_2_le): New instruction pattern.
(*mov_sitf_e500_subreg12): Rename to...
(*mov_sitf_e500_subreg12_be): ... this. Restrict to the big
endianness only.
(*mov_sitf_e500_subreg12_le): New instruction pattern.
(*mov_sitf_e500_subreg12_2): Rename to...
(*mov_sitf_e500_subreg12_2_be): ... this. Restrict to the big
endianness only.
(*mov_sitf_e500_subreg12_2_le): New instruction pattern.
2014-07-07 Max Ostapenko <m.ostapenko@partner.samsung.com> 2014-07-07 Max Ostapenko <m.ostapenko@partner.samsung.com>
* asan.c (instrument_strlen_call): Do not instrument first byte in strlen * asan.c (instrument_strlen_call): Do not instrument first byte in strlen
......
...@@ -5300,8 +5300,10 @@ output_vec_const_move (rtx *operands) ...@@ -5300,8 +5300,10 @@ output_vec_const_move (rtx *operands)
operands[2] = CONST_VECTOR_ELT (vec, 1); operands[2] = CONST_VECTOR_ELT (vec, 1);
if (cst == cst2) if (cst == cst2)
return "li %0,%1\n\tevmergelo %0,%0,%0"; return "li %0,%1\n\tevmergelo %0,%0,%0";
else else if (WORDS_BIG_ENDIAN)
return "li %0,%1\n\tevmergelo %0,%0,%0\n\tli %0,%2"; return "li %0,%1\n\tevmergelo %0,%0,%0\n\tli %0,%2";
else
return "li %0,%2\n\tevmergelo %0,%0,%0\n\tli %0,%1";
} }
/* Initialize TARGET of vector PAIRED to VALS. */ /* Initialize TARGET of vector PAIRED to VALS. */
......
2014-07-07 Maciej W. Rozycki <macro@codesourcery.com>
* gcc.target/powerpc/spe-evmerge.c: New file.
2014-07-07 Paolo Carlini <paolo.carlini@oracle.com> 2014-07-07 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/override1.C: Tweak expected error messages. * g++.dg/cpp0x/override1.C: Tweak expected error messages.
......
/* Verify SPE vector permute builtins. */
/* { dg-do run { target { powerpc*-*-* && powerpc_spe } } } */
/* Remove `-ansi' from options so that <spe.h> compiles. */
/* { dg-options "" } */
#include <spe.h>
#include <stdlib.h>
#define vector __attribute__ ((vector_size (8)))
#define WORDS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
int
main (void)
{
vector int a = { 0x11111111, 0x22222222 };
vector int b = { 0x33333333, 0x44444444 };
vector int c;
/* c[hi] = a[hi], c[lo] = b[hi] */
c = __ev_mergehi (a, b);
if (c[0] != (WORDS_BIG_ENDIAN ? 0x11111111 : 0x44444444))
abort ();
if (c[1] != (WORDS_BIG_ENDIAN ? 0x33333333 : 0x22222222))
abort ();
/* c[hi] = a[lo], c[lo] = b[lo] */
c = __ev_mergelo (a, b);
if (c[0] != (WORDS_BIG_ENDIAN ? 0x22222222 : 0x33333333))
abort ();
if (c[1] != (WORDS_BIG_ENDIAN ? 0x44444444 : 0x11111111))
abort ();
/* c[hi] = a[lo], c[lo] = b[hi] */
c = __ev_mergelohi (a, b);
if (c[0] != (WORDS_BIG_ENDIAN ? 0x22222222 : 0x44444444))
abort ();
if (c[1] != (WORDS_BIG_ENDIAN ? 0x33333333 : 0x11111111))
abort ();
/* c[hi] = a[hi], c[lo] = b[lo] */
c = __ev_mergehilo (a, b);
if (c[0] != (WORDS_BIG_ENDIAN ? 0x11111111 : 0x33333333))
abort ();
if (c[1] != (WORDS_BIG_ENDIAN ? 0x44444444 : 0x22222222))
abort ();
/* c[hi] = a[hi], c[lo] = b[hi] */
c = __builtin_spe_evmergehi (a, b);
if (c[0] != (WORDS_BIG_ENDIAN ? 0x11111111 : 0x44444444))
abort ();
if (c[1] != (WORDS_BIG_ENDIAN ? 0x33333333 : 0x22222222))
abort ();
/* c[hi] = a[lo], c[lo] = b[lo] */
c = __builtin_spe_evmergelo (a, b);
if (c[0] != (WORDS_BIG_ENDIAN ? 0x22222222 : 0x33333333))
abort ();
if (c[1] != (WORDS_BIG_ENDIAN ? 0x44444444 : 0x11111111))
abort ();
/* c[hi] = a[lo], c[lo] = b[hi] */
c = __builtin_spe_evmergelohi (a, b);
if (c[0] != (WORDS_BIG_ENDIAN ? 0x22222222 : 0x44444444))
abort ();
if (c[1] != (WORDS_BIG_ENDIAN ? 0x33333333 : 0x11111111))
abort ();
/* c[hi] = a[hi], c[lo] = b[lo] */
c = __builtin_spe_evmergehilo (a, b);
if (c[0] != (WORDS_BIG_ENDIAN ? 0x11111111 : 0x33333333))
abort ();
if (c[1] != (WORDS_BIG_ENDIAN ? 0x44444444 : 0x22222222))
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment