[PATCH] Fold single imm use of a FMA if it is a negation [PR95060]

Jakub Jelinek jakub@redhat.com
Wed May 13 08:16:36 GMT 2020


Hi!

match.pd already has simplifications for negation of a FMA (FMS, FNMA, FNMS)
call if it is single use, but when the widening_mul pass discovers FMAs,
nothing folds the statements anymore.

So, the following patch adjusts the widening_mul pass to handle that.

I had to adjust quite a lot of tests, because they have in them nested FMAs
(one FMA feeding another one) and the patch results in some (equivalent) changes
in the chosen instructions, previously the negation of one FMA's result
would result in the dependent FMA being adjusted for the negation, but now
instead the first FMA is adjusted.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2020-05-13  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/95060
	* tree-ssa-math-opts.c (convert_mult_to_fma_1): Fold a NEGATE_EXPR
	if it is the single use of the FMA internal builtin.

	* gcc.target/i386/avx512f-pr95060.c: New test.
	* gcc.target/i386/fma_double_1.c: Adjust expected insn counts.
	* gcc.target/i386/fma_double_2.c: Likewise.
	* gcc.target/i386/fma_double_3.c: Likewise.
	* gcc.target/i386/fma_double_4.c: Likewise.
	* gcc.target/i386/fma_double_5.c: Likewise.
	* gcc.target/i386/fma_double_6.c: Likewise.
	* gcc.target/i386/fma_float_1.c: Likewise.
	* gcc.target/i386/fma_float_2.c: Likewise.
	* gcc.target/i386/fma_float_3.c: Likewise.
	* gcc.target/i386/fma_float_4.c: Likewise.
	* gcc.target/i386/fma_float_5.c: Likewise.
	* gcc.target/i386/fma_float_6.c: Likewise.
	* gcc.target/i386/l_fma_double_1.c: Likewise.
	* gcc.target/i386/l_fma_double_2.c: Likewise.
	* gcc.target/i386/l_fma_double_3.c: Likewise.
	* gcc.target/i386/l_fma_double_4.c: Likewise.
	* gcc.target/i386/l_fma_double_5.c: Likewise.
	* gcc.target/i386/l_fma_double_6.c: Likewise.
	* gcc.target/i386/l_fma_float_1.c: Likewise.
	* gcc.target/i386/l_fma_float_2.c: Likewise.
	* gcc.target/i386/l_fma_float_3.c: Likewise.
	* gcc.target/i386/l_fma_float_4.c: Likewise.
	* gcc.target/i386/l_fma_float_5.c: Likewise.
	* gcc.target/i386/l_fma_float_6.c: Likewise.

--- gcc/tree-ssa-math-opts.c.jj	2020-03-26 09:14:53.367045348 +0100
+++ gcc/tree-ssa-math-opts.c	2020-05-12 12:06:19.718387179 +0200
@@ -2930,6 +2930,35 @@ convert_mult_to_fma_1 (tree mul_result,
 	  fprintf (dump_file, "\n");
 	}
 
+      /* If the FMA result is negated in a single use, fold the negation
+	 too.  */
+      orig_stmt = gsi_stmt (gsi);
+      use_operand_p use_p;
+      gimple *neg_stmt;
+      if (is_gimple_call (orig_stmt)
+	  && gimple_call_internal_p (orig_stmt)
+	  && gimple_call_lhs (orig_stmt)
+	  && TREE_CODE (gimple_call_lhs (orig_stmt)) == SSA_NAME
+	  && single_imm_use (gimple_call_lhs (orig_stmt), &use_p, &neg_stmt)
+	  && is_gimple_assign (neg_stmt)
+	  && gimple_assign_rhs_code (neg_stmt) == NEGATE_EXPR
+	  && !stmt_could_throw_p (cfun, neg_stmt))
+	{
+	  gsi = gsi_for_stmt (neg_stmt);
+	  if (fold_stmt (&gsi, follow_all_ssa_edges))
+	    {
+	      if (maybe_clean_or_replace_eh_stmt (neg_stmt, gsi_stmt (gsi)))
+		gcc_unreachable ();
+	      update_stmt (gsi_stmt (gsi));
+	      if (dump_file && (dump_flags & TDF_DETAILS))
+		{
+		  fprintf (dump_file, "Folded FMA negation ");
+		  print_gimple_stmt (dump_file, gsi_stmt (gsi), 0, TDF_NONE);
+		  fprintf (dump_file, "\n");
+		}
+	    }
+	}
+
       widen_mul_stats.fmas_inserted++;
     }
 }
--- gcc/testsuite/gcc.target/i386/avx512f-pr95060.c.jj	2020-05-12 12:17:16.052468438 +0200
+++ gcc/testsuite/gcc.target/i386/avx512f-pr95060.c	2020-05-12 12:16:52.333826884 +0200
@@ -0,0 +1,22 @@
+/* PR tree-optimization/95060 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -mavx512f" } */
+/* { dg-final { scan-assembler "\tvfnmsub" } } */
+/* { dg-final { scan-assembler-not "\tvfmadd" } } */
+
+#define N 32
+float r[N], a[N], b[N], c[N];
+
+void
+foo (void)
+{
+  for (int i = 0; i < N; i++)
+    r[i] = -(a[i] * b[i]) - c[i];
+}
+
+void
+bar (void)
+{
+  for (int i = 0; i < N; i++)
+    r[i] = -(a[i] * b[i] + c[i]);
+}
--- gcc/testsuite/gcc.target/i386/fma_double_1.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_double_1.c	2020-05-13 09:55:10.878118046 +0200
@@ -8,11 +8,9 @@
 
 #include "fma_1.h"
 
-/* { dg-final { scan-assembler-times "vfmadd132sd" 4  } } */
+/* { dg-final { scan-assembler-times "vfmadd132sd" 8  } } */
 /* { dg-final { scan-assembler-times "vfmadd231sd" 4  } } */
-/* { dg-final { scan-assembler-times "vfmsub132sd" 4  } } */
+/* { dg-final { scan-assembler-times "vfmsub132sd" 8  } } */
 /* { dg-final { scan-assembler-times "vfmsub231sd" 4  } } */
-/* { dg-final { scan-assembler-times "vfnmadd132sd" 4  } } */
 /* { dg-final { scan-assembler-times "vfnmadd231sd" 4  } } */
-/* { dg-final { scan-assembler-times "vfnmsub132sd" 4  } } */
 /* { dg-final { scan-assembler-times "vfnmsub231sd" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_double_2.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_double_2.c	2020-05-13 09:56:17.757094905 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_2.h"
 
-/* { dg-final { scan-assembler-times "vfmadd132sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub132sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd132sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub132sd" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd132sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub132sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd132sd" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub132sd" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_double_3.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_double_3.c	2020-05-13 09:57:19.900144210 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_3.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub\[132\]+sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[132\]+sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[132\]+sd" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub\[132\]+sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[132\]+sd" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[132\]+sd" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_double_4.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_double_4.c	2020-05-13 09:57:31.878960955 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_4.h"
 
-/* { dg-final { scan-assembler-times "vfmadd132sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub132sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd132sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub132sd" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd132sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub132sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd132sd" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub132sd" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_double_5.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_double_5.c	2020-05-13 09:58:15.726290158 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_5.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[132\]+sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub\[132\]+sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[132\]+sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[132\]+sd" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd\[132\]+sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub\[132\]+sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[132\]+sd" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[132\]+sd" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_double_6.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_double_6.c	2020-05-13 09:58:04.370463886 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_6.h"
 
-/* { dg-final { scan-assembler-times "vfmadd132sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub132sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd132sd" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub132sd" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd132sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub132sd" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd132sd" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub132sd" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_float_1.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_float_1.c	2020-05-13 09:59:07.123503863 +0200
@@ -8,11 +8,9 @@
 
 #include "fma_1.h"
 
-/* { dg-final { scan-assembler-times "vfmadd132ss" 4  } } */
+/* { dg-final { scan-assembler-times "vfmadd132ss" 8  } } */
 /* { dg-final { scan-assembler-times "vfmadd231ss" 4  } } */
-/* { dg-final { scan-assembler-times "vfmsub132ss" 4  } } */
+/* { dg-final { scan-assembler-times "vfmsub132ss" 8  } } */
 /* { dg-final { scan-assembler-times "vfmsub231ss" 4  } } */
-/* { dg-final { scan-assembler-times "vfnmadd132ss" 4  } } */
 /* { dg-final { scan-assembler-times "vfnmadd231ss" 4  } } */
-/* { dg-final { scan-assembler-times "vfnmsub132ss" 4  } } */
 /* { dg-final { scan-assembler-times "vfnmsub231ss" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_float_2.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_float_2.c	2020-05-13 09:59:17.766341046 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_2.h"
 
-/* { dg-final { scan-assembler-times "vfmadd132ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub132ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd132ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub132ss" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd132ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub132ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd132ss" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub132ss" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_float_3.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_float_3.c	2020-05-13 09:59:38.789019430 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_3.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[132\]+ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub\[132\]+ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[132\]+ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[132\]+ss" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd\[132\]+ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub\[132\]+ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[132\]+ss" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[132\]+ss" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_float_4.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_float_4.c	2020-05-13 09:59:44.778927796 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_4.h"
 
-/* { dg-final { scan-assembler-times "vfmadd132ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub132ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd132ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub132ss" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd132ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub132ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd132ss" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub132ss" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_float_5.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_float_5.c	2020-05-13 09:59:48.615869091 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_5.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[132\]+ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub\[132\]+ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[132\]+ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[132\]+ss" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd\[132\]+ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub\[132\]+ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[132\]+ss" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[132\]+ss" 4  } } */
--- gcc/testsuite/gcc.target/i386/fma_float_6.c.jj	2020-01-12 11:54:37.943390325 +0100
+++ gcc/testsuite/gcc.target/i386/fma_float_6.c	2020-05-13 09:59:53.157799608 +0200
@@ -8,7 +8,7 @@
 
 #include "fma_6.h"
 
-/* { dg-final { scan-assembler-times "vfmadd132ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfmsub132ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmadd132ss" 8  } } */
-/* { dg-final { scan-assembler-times "vfnmsub132ss" 8  } } */
+/* { dg-final { scan-assembler-times "vfmadd132ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfmsub132ss" 12  } } */
+/* { dg-final { scan-assembler-times "vfnmadd132ss" 4  } } */
+/* { dg-final { scan-assembler-times "vfnmsub132ss" 4  } } */
--- gcc/testsuite/gcc.target/i386/l_fma_double_1.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_double_1.c	2020-05-13 10:02:24.492484423 +0200
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((al
 
 #include "l_fma_1.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_double_2.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_double_2.c	2020-05-13 10:03:02.391904624 +0200
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((al
 
 #include "l_fma_2.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_double_3.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_double_3.c	2020-05-13 10:03:26.153541113 +0200
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((al
 
 #include "l_fma_3.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_double_4.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_double_4.c	2020-05-13 10:03:40.144327075 +0200
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((al
 
 #include "l_fma_4.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_double_5.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_double_5.c	2020-05-13 10:03:54.332110020 +0200
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((al
 
 #include "l_fma_5.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_double_6.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_double_6.c	2020-05-13 10:04:06.745920111 +0200
@@ -11,11 +11,11 @@ typedef double adouble __attribute__((al
 
 #include "l_fma_6.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 32 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 32 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 48 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 16 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 16 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_float_1.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_float_1.c	2020-05-13 10:04:40.143409183 +0200
@@ -10,11 +10,11 @@
 
 #include "l_fma_1.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_float_2.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_float_2.c	2020-05-13 10:04:52.398221702 +0200
@@ -10,11 +10,11 @@
 
 #include "l_fma_2.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_float_3.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_float_3.c	2020-05-13 10:05:02.820062261 +0200
@@ -10,11 +10,11 @@
 
 #include "l_fma_3.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_float_4.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_float_4.c	2020-05-13 10:05:15.141873758 +0200
@@ -10,11 +10,11 @@
 
 #include "l_fma_4.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_float_5.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_float_5.c	2020-05-13 10:05:24.671727964 +0200
@@ -10,11 +10,11 @@
 
 #include "l_fma_5.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */
--- gcc/testsuite/gcc.target/i386/l_fma_float_6.c.jj	2020-01-12 11:54:37.950390220 +0100
+++ gcc/testsuite/gcc.target/i386/l_fma_float_6.c	2020-05-13 10:05:34.629575629 +0200
@@ -10,11 +10,11 @@
 
 #include "l_fma_6.h"
 
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */
-/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 64 } } */
-/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 64 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 12 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 4 } } */
+/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 96 } } */
+/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 32 } } */
+/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 32 } } */

	Jakub



More information about the Gcc-patches mailing list