Patchwork Add sparc fmaf test.

login
register
mail settings
Submitter David Miller
Date Oct. 27, 2011, 12:01 a.m.
Message ID <20111026.200150.260254894381238222.davem@davemloft.net>
Download mbox | patch
Permalink /patch/122041/
State New
Headers show

Comments

David Miller - Oct. 27, 2011, 12:01 a.m.
Committed to trunk.

gcc/testsuite/

	* gcc.target/sparc/fmaf-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180551 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/testsuite/ChangeLog                 |    2 +
 gcc/testsuite/gcc.target/sparc/fmaf-1.c |   51 +++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/sparc/fmaf-1.c

Patch

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2879dfe..6078fdd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,7 @@ 
 2011-10-26  David S. Miller  <davem@davemloft.net>
 
+	* gcc.target/sparc/fmaf-1.c: New test.
+
 	* gcc.target/sparc/setcc-1.c: New test.
 	* gcc.target/sparc/setcc-2.c: New test.
 
diff --git a/gcc/testsuite/gcc.target/sparc/fmaf-1.c b/gcc/testsuite/gcc.target/sparc/fmaf-1.c
new file mode 100644
index 0000000..948b926
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/fmaf-1.c
@@ -0,0 +1,51 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2 -mfmaf" } */
+
+float fmadds (float a, float b, float c)
+{
+  return a * b + c;
+}
+
+float fmsubs (float a, float b, float c)
+{
+  return a * b - c;
+}
+
+float fnmadds (float a, float b, float c)
+{
+  return -(a * b + c);
+}
+
+float fnmsubs (float a, float b, float c)
+{
+  return -(a * b - c);
+}
+
+double fmaddd (double a, double b, double c)
+{
+  return a * b + c;
+}
+
+double fmsubd (double a, double b, double c)
+{
+  return a * b - c;
+}
+
+double fnmaddd (double a, double b, double c)
+{
+  return -(a * b + c);
+}
+
+double fnmsubd (double a, double b, double c)
+{
+  return -(a * b - c);
+}
+
+/* { dg-final { scan-assembler "fmadds\t%" } } */
+/* { dg-final { scan-assembler "fmsubs\t%" } } */
+/* { dg-final { scan-assembler "fnmadds\t%" } } */
+/* { dg-final { scan-assembler "fnmsubs\t%" } } */
+/* { dg-final { scan-assembler "fmaddd\t%" } } */
+/* { dg-final { scan-assembler "fmsubd\t%" } } */
+/* { dg-final { scan-assembler "fnmaddd\t%" } } */
+/* { dg-final { scan-assembler "fnmsubd\t%" } } */