altivec.md (altivec_vsumsws): Replace second vspltw with vsldoi.

gcc:

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

	* config/rs6000/altivec.md (altivec_vsumsws): Replace second
	vspltw with vsldoi.
	(reduc_uplus_v16qi): Use gen_altivec_vsumsws_direct instead of
	gen_altivec_vsumsws.

gcc/testsuite:

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

	* gcc.dg/vmx/vsums.c: Check entire result vector.
	* gcc.dg/vmx/vsums-be-order.c: Likewise.

From-SVN: r208021
This commit is contained in:
Bill Schmidt 2014-02-21 21:01:01 +00:00 committed by William Schmidt
parent 4b3a6bcbcc
commit b90ab1ba8c
5 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2014-02-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/altivec.md (altivec_vsumsws): Replace second
vspltw with vsldoi.
(reduc_uplus_v16qi): Use gen_altivec_vsumsws_direct instead of
gen_altivec_vsumsws.
2014-02-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/altivec.md (altivec_lvxl): Rename as

View File

@ -1651,7 +1651,7 @@
if (VECTOR_ELT_ORDER_BIG)
return "vsumsws %0,%1,%2";
else
return "vspltw %3,%2,0\n\tvsumsws %3,%1,%3\n\tvspltw %0,%3,3";
return "vspltw %3,%2,0\n\tvsumsws %3,%1,%3\n\tvsldoi %0,%3,%3,12";
}
[(set_attr "type" "veccomplex")
(set (attr "length")
@ -2539,7 +2539,7 @@
emit_insn (gen_altivec_vspltisw (vzero, const0_rtx));
emit_insn (gen_altivec_vsum4ubs (vtmp1, operands[1], vzero));
emit_insn (gen_altivec_vsumsws (dest, vtmp1, vzero));
emit_insn (gen_altivec_vsumsws_direct (dest, vtmp1, vzero));
DONE;
})

View File

@ -1,3 +1,8 @@
2014-02-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.dg/vmx/vsums.c: Check entire result vector.
* gcc.dg/vmx/vsums-be-order.c: Likewise.
2014-02-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.dg/vmx/ld.c: New test.

View File

@ -8,12 +8,13 @@ static void test()
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
vector signed int vb = {128,0,0,0};
vector signed int evd = {136,0,0,0};
#else
vector signed int vb = {0,0,0,128};
vector signed int evd = {0,0,0,136};
#endif
vector signed int vd = vec_sums (va, vb);
signed int r = vec_extract (vd, 3);
check (r == 136, "sums");
check (vec_all_eq (vd, evd), "sums");
}

View File

@ -4,9 +4,9 @@ static void test()
{
vector signed int va = {-7,11,-13,17};
vector signed int vb = {0,0,0,128};
vector signed int evd = {0,0,0,136};
vector signed int vd = vec_sums (va, vb);
signed int r = vec_extract (vd, 3);
check (r == 136, "sums");
check (vec_all_eq (vd, evd), "sums");
}