Commit b90ab1ba by Bill Schmidt Committed by William Schmidt

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
parent 4b3a6bcb
2014-02-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 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 * config/rs6000/altivec.md (altivec_lvxl): Rename as
*altivec_lvxl_<mode>_internal and use VM2 iterator instead of *altivec_lvxl_<mode>_internal and use VM2 iterator instead of
V4SI. V4SI.
......
...@@ -1651,7 +1651,7 @@ ...@@ -1651,7 +1651,7 @@
if (VECTOR_ELT_ORDER_BIG) if (VECTOR_ELT_ORDER_BIG)
return "vsumsws %0,%1,%2"; return "vsumsws %0,%1,%2";
else 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 "type" "veccomplex")
(set (attr "length") (set (attr "length")
...@@ -2539,7 +2539,7 @@ ...@@ -2539,7 +2539,7 @@
emit_insn (gen_altivec_vspltisw (vzero, const0_rtx)); emit_insn (gen_altivec_vspltisw (vzero, const0_rtx));
emit_insn (gen_altivec_vsum4ubs (vtmp1, operands[1], vzero)); 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; DONE;
}) })
......
2014-02-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 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. * gcc.dg/vmx/ld.c: New test.
* gcc.dg/vmx/ld-be-order.c: New test. * gcc.dg/vmx/ld-be-order.c: New test.
* gcc.dg/vmx/ld-vsx.c: New test. * gcc.dg/vmx/ld-vsx.c: New test.
......
...@@ -8,12 +8,13 @@ static void test() ...@@ -8,12 +8,13 @@ static void test()
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
vector signed int vb = {128,0,0,0}; vector signed int vb = {128,0,0,0};
vector signed int evd = {136,0,0,0};
#else #else
vector signed int vb = {0,0,0,128}; vector signed int vb = {0,0,0,128};
vector signed int evd = {0,0,0,136};
#endif #endif
vector signed int vd = vec_sums (va, vb); 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");
} }
...@@ -4,9 +4,9 @@ static void test() ...@@ -4,9 +4,9 @@ static void test()
{ {
vector signed int va = {-7,11,-13,17}; vector signed int va = {-7,11,-13,17};
vector signed int vb = {0,0,0,128}; vector signed int vb = {0,0,0,128};
vector signed int evd = {0,0,0,136};
vector signed int vd = vec_sums (va, vb); 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");
} }
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