Blame SOURCES/gcc48-pr66731.patch

56d343
2015-08-04  Szabolcs Nagy  <szabolcs.nagy@arm.com>
56d343
56d343
	Backport from mainline:
56d343
	2015-07-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>
56d343
56d343
	PR target/66731
56d343
	* config/aarch64/aarch64.md (fnmul<mode>3): Handle -frounding-math.
56d343
56d343
	* gcc.target/aarch64/fnmul-1.c: New.
56d343
	* gcc.target/aarch64/fnmul-2.c: New.
56d343
	* gcc.target/aarch64/fnmul-3.c: New.
56d343
	* gcc.target/aarch64/fnmul-4.c: New.
56d343
56d343
--- gcc/config/aarch64/aarch64.md	(revision 226591)
56d343
+++ gcc/config/aarch64/aarch64.md	(revision 226592)
56d343
@@ -3101,6 +3101,17 @@
56d343
         (mult:GPF
56d343
 		 (neg:GPF (match_operand:GPF 1 "register_operand" "w"))
56d343
 		 (match_operand:GPF 2 "register_operand" "w")))]
56d343
+  "TARGET_FLOAT && !flag_rounding_math"
56d343
+  "fnmul\\t%<s>0, %<s>1, %<s>2"
56d343
+  [(set_attr "v8type" "fmul")
56d343
+   (set_attr "mode" "<MODE>")]
56d343
+)
56d343
+
56d343
+(define_insn "*fnmul<mode>3"
56d343
+  [(set (match_operand:GPF 0 "register_operand" "=w")
56d343
+        (neg:GPF (mult:GPF
56d343
+		 (match_operand:GPF 1 "register_operand" "w")
56d343
+		 (match_operand:GPF 2 "register_operand" "w"))))]
56d343
   "TARGET_FLOAT"
56d343
   "fnmul\\t%<s>0, %<s>1, %<s>2"
56d343
   [(set_attr "v8type" "fmul")
56d343
--- gcc/testsuite/gcc.target/aarch64/fnmul-1.c	(nonexistent)
56d343
+++ gcc/testsuite/gcc.target/aarch64/fnmul-1.c	(revision 226592)
56d343
@@ -0,0 +1,16 @@
56d343
+/* { dg-do compile } */
56d343
+/* { dg-options "-O2" } */
56d343
+
56d343
+double
56d343
+foo_d (double a, double b)
56d343
+{
56d343
+  /* { dg-final { scan-assembler "fnmul\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" } } */
56d343
+  return -a * b;
56d343
+}
56d343
+
56d343
+float
56d343
+foo_s (float a, float b)
56d343
+{
56d343
+  /* { dg-final { scan-assembler "fnmul\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" } } */
56d343
+  return -a * b;
56d343
+}
56d343
--- gcc/testsuite/gcc.target/aarch64/fnmul-2.c	(nonexistent)
56d343
+++ gcc/testsuite/gcc.target/aarch64/fnmul-2.c	(revision 226592)
56d343
@@ -0,0 +1,18 @@
56d343
+/* { dg-do compile } */
56d343
+/* { dg-options "-O2 -frounding-math" } */
56d343
+
56d343
+double
56d343
+foo_d (double a, double b)
56d343
+{
56d343
+  /* { dg-final { scan-assembler "fneg\\td\[0-9\]+, d\[0-9\]+" } } */
56d343
+  /* { dg-final { scan-assembler "fmul\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" } } */
56d343
+  return -a * b;
56d343
+}
56d343
+
56d343
+float
56d343
+foo_s (float a, float b)
56d343
+{
56d343
+  /* { dg-final { scan-assembler "fneg\\ts\[0-9\]+, s\[0-9\]+" } } */
56d343
+  /* { dg-final { scan-assembler "fmul\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" } } */
56d343
+  return -a * b;
56d343
+}
56d343
--- gcc/testsuite/gcc.target/aarch64/fnmul-3.c	(nonexistent)
56d343
+++ gcc/testsuite/gcc.target/aarch64/fnmul-3.c	(revision 226592)
56d343
@@ -0,0 +1,16 @@
56d343
+/* { dg-do compile } */
56d343
+/* { dg-options "-O2" } */
56d343
+
56d343
+double
56d343
+foo_d (double a, double b)
56d343
+{
56d343
+  /* { dg-final { scan-assembler "fnmul\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" } } */
56d343
+  return -(a * b);
56d343
+}
56d343
+
56d343
+float
56d343
+foo_s (float a, float b)
56d343
+{
56d343
+  /* { dg-final { scan-assembler "fnmul\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" } } */
56d343
+  return -(a * b);
56d343
+}
56d343
--- gcc/testsuite/gcc.target/aarch64/fnmul-4.c	(nonexistent)
56d343
+++ gcc/testsuite/gcc.target/aarch64/fnmul-4.c	(revision 226592)
56d343
@@ -0,0 +1,16 @@
56d343
+/* { dg-do compile } */
56d343
+/* { dg-options "-O2 -frounding-math" } */
56d343
+
56d343
+double
56d343
+foo_d (double a, double b)
56d343
+{
56d343
+  /* { dg-final { scan-assembler "fnmul\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" } } */
56d343
+  return -(a * b);
56d343
+}
56d343
+
56d343
+float
56d343
+foo_s (float a, float b)
56d343
+{
56d343
+  /* { dg-final { scan-assembler "fnmul\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" } } */
56d343
+  return -(a * b);
56d343
+}