@@ -1428,6 +1428,10 @@ Target supports a vector widening multiplication of @code{short} operands
into @code{int} results, or can promote (unpack) from @code{short} to
@code{int} and perform non-widening multiplication of @code{int}.
+@item vect_widen_mult_si_to_di_pattern
+Target supports a vector widening multiplication of @code{int} operands
+into @code{long} results.
+
@item vect_sdot_qi
Target supports a vector dot-product of @code{signed char}.
@@ -1,3 +1,11 @@
+2014-04-07 Cong Hou <congh@google.com>
+
+ PR testsuite/60773
+ * lib/target-supports.exp:
+ Add check_effective_target_vect_widen_mult_si_to_di_pattern.
+ * gcc.dg/vect/pr60656.c: Update the test by checking if the targets
+ vect_widen_mult_si_to_di_pattern and vect_long are supported.
+
2014-03-28 Cong Hou <congh@google.com>
PR tree-optimization/60656
@@ -1,4 +1,5 @@
/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_long } */
#include "tree-vect.h"
@@ -12,7 +13,7 @@ foo ()
for(i = 0; i < 4; ++i)
{
long P = v[i];
- s += P*P*P;
+ s += P * P * P;
}
return s;
}
@@ -27,7 +28,7 @@ bar ()
for(i = 0; i < 4; ++i)
{
long P = v[i];
- s += P*P*P;
+ s += P * P * P;
__asm__ volatile ("");
}
return s;
@@ -35,11 +36,12 @@ bar ()
int main()
{
+ check_vect ();
+
if (foo () != bar ())
abort ();
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_si_to_di_pattern } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
-
@@ -3732,6 +3732,27 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
}
# Return 1 if the target plus current options supports a vector
+# widening multiplication of *int* args into *long* result, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_widen_mult_si_to_di_pattern { } {
+ global et_vect_widen_mult_si_to_di_pattern
+
+ if [info exists et_vect_widen_mult_si_to_di_pattern_saved] {
+ verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: using cached result" 2
+ } else {
+ if {[istarget ia64-*-*]
+ || [istarget i?86-*-*]
+ || [istarget x86_64-*-*] } {
+ set et_vect_widen_mult_si_to_di_pattern_saved 1
+ }
+ }
+ verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: returning $et_vect_widen_mult_si_to_di_pattern_saved" 2
+ return $et_vect_widen_mult_si_to_di_pattern_saved
+}
+
+# Return 1 if the target plus current options supports a vector
# widening shift, 0 otherwise.
#
# This won't change for different subtargets so cache the result.