2020-05-14 10:48:46 +08:00
|
|
|
diff -Nurp a/gcc/testsuite/gcc.dg/pr94269.c b/gcc/testsuite/gcc.dg/pr94269.c
|
|
|
|
|
--- a/gcc/testsuite/gcc.dg/pr94269.c 1970-01-01 08:00:00.000000000 +0800
|
|
|
|
|
+++ b/gcc/testsuite/gcc.dg/pr94269.c 2020-04-17 17:04:50.608000000 +0800
|
|
|
|
|
@@ -0,0 +1,26 @@
|
|
|
|
|
+/* { dg-do compile { target aarch64*-*-* } } */
|
|
|
|
|
+/* { dg-options "-O2 -ftree-loop-vectorize -funsafe-math-optimizations -march=armv8.2-a+sve -msve-vector-bits=256" } */
|
|
|
|
|
+
|
|
|
|
|
+float
|
|
|
|
|
+foo(long n, float *x, int inc_x,
|
|
|
|
|
+ float *y, int inc_y)
|
|
|
|
|
+{
|
|
|
|
|
+ float dot = 0.0;
|
|
|
|
|
+ int ix = 0, iy = 0;
|
|
|
|
|
+
|
|
|
|
|
+ if (n < 0) {
|
|
|
|
|
+ return dot;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ int i = 0;
|
|
|
|
|
+ while (i < n) {
|
|
|
|
|
+ dot += y[iy] * x[ix];
|
|
|
|
|
+ ix += inc_x;
|
|
|
|
|
+ iy += inc_y;
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return dot;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* { dg-final { scan-assembler-not "smaddl" { target aarch64*-*-* } } } */
|
|
|
|
|
diff -Nurp a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
|
|
|
|
|
--- a/gcc/tree-ssa-math-opts.c 2020-04-17 16:43:59.540000000 +0800
|
|
|
|
|
+++ b/gcc/tree-ssa-math-opts.c 2020-04-17 16:48:34.072036000 +0800
|
|
|
|
|
@@ -2721,11 +2721,14 @@ convert_plusminus_to_widen (gimple_stmt_
|
|
|
|
|
multiply-and-accumulate instructions.
|
|
|
|
|
|
|
|
|
|
If the widened-multiplication result has more than one uses, it is
|
|
|
|
|
- probably wiser not to do the conversion. */
|
|
|
|
|
+ probably wiser not to do the conversion. Also restrict this operation
|
|
|
|
|
+ to single basic block to avoid moving the multiply to a different block
|
|
|
|
|
+ with a higher execution frequency. */
|
|
|
|
|
if (code == PLUS_EXPR
|
|
|
|
|
&& (rhs1_code == MULT_EXPR || rhs1_code == WIDEN_MULT_EXPR))
|
|
|
|
|
{
|
|
|
|
|
if (!has_single_use (rhs1)
|
|
|
|
|
+ || gimple_bb (rhs1_stmt) != gimple_bb (stmt)
|
|
|
|
|
|| !is_widening_mult_p (rhs1_stmt, &type1, &mult_rhs1,
|
|
|
|
|
&type2, &mult_rhs2))
|
|
|
|
|
return false;
|
|
|
|
|
@@ -2735,6 +2738,7 @@ convert_plusminus_to_widen (gimple_stmt_
|
|
|
|
|
else if (rhs2_code == MULT_EXPR || rhs2_code == WIDEN_MULT_EXPR)
|
|
|
|
|
{
|
|
|
|
|
if (!has_single_use (rhs2)
|
|
|
|
|
+ || gimple_bb (rhs2_stmt) != gimple_bb (stmt)
|
|
|
|
|
|| !is_widening_mult_p (rhs2_stmt, &type1, &mult_rhs1,
|
|
|
|
|
&type2, &mult_rhs2))
|
|
|
|
|
return false;
|
2020-05-20 11:14:06 +08:00
|
|
|
diff -Nurp a/gcc/testsuite/gcc.target/aarch64/sve/var_stride_1.c b/gcc/testsuite/gcc.target/aarch64/sve/var_stride_1.c
|
|
|
|
|
--- a/gcc/testsuite/gcc.target/aarch64/sve/var_stride_1.c 2020-03-31 09:51:36.000000000 +0800
|
|
|
|
|
+++ b/gcc/testsuite/gcc.target/aarch64/sve/var_stride_1.c 2020-04-29 10:55:44.937471475 +0800
|
2020-05-20 11:19:38 +08:00
|
|
|
@@ -17,7 +17,6 @@ f (TYPE *x, TYPE *y, unsigned short n, l
|
2020-05-20 11:14:06 +08:00
|
|
|
/* { dg-final { scan-assembler {\tstr\tw[0-9]+} } } */
|
|
|
|
|
/* Should multiply by (VF-1)*4 rather than (257-1)*4. */
|
|
|
|
|
/* { dg-final { scan-assembler-not {, 1024} } } */
|
|
|
|
|
-/* { dg-final { scan-assembler-not {\t.bfiz\t} } } */
|
|
|
|
|
/* { dg-final { scan-assembler-not {lsl[^\n]*[, ]10} } } */
|
|
|
|
|
/* { dg-final { scan-assembler-not {\tcmp\tx[0-9]+, 0} } } */
|
|
|
|
|
/* { dg-final { scan-assembler-not {\tcmp\tw[0-9]+, 0} } } */
|