Patchwork Add some sparc VIS3 move test cases.

login
register
mail settings
Submitter David Miller
Date Oct. 25, 2011, 3:24 a.m.
Message ID <20111024.232401.724996514195736880.davem@davemloft.net>
Download mbox | patch
Permalink /patch/121473/
State New
Headers show

Comments

David Miller - Oct. 25, 2011, 3:24 a.m.
Comitted to trunk.

gcc/testsuite/

	* gcc.target/sparc/vis3move-1.c: New test.
	* gcc.target/sparc/vis3move-2.c: New test.
	* gcc.target/sparc/vis3move-3.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180418 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/testsuite/ChangeLog                     |    6 ++++
 gcc/testsuite/gcc.target/sparc/vis3move-1.c |   29 +++++++++++++++++++
 gcc/testsuite/gcc.target/sparc/vis3move-2.c |   29 +++++++++++++++++++
 gcc/testsuite/gcc.target/sparc/vis3move-3.c |   41 +++++++++++++++++++++++++++
 4 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/sparc/vis3move-1.c
 create mode 100644 gcc/testsuite/gcc.target/sparc/vis3move-2.c
 create mode 100644 gcc/testsuite/gcc.target/sparc/vis3move-3.c

Patch

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0e7ee4c..fe0a135 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@ 
+2011-10-24  David S. Miller  <davem@davemloft.net>
+
+	* gcc.target/sparc/vis3move-1.c: New test.
+	* gcc.target/sparc/vis3move-2.c: New test.
+	* gcc.target/sparc/vis3move-3.c: New test.
+
 2011-10-24  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
 	* gcc.dg/strlenopt-22.c: New testcase.
diff --git a/gcc/testsuite/gcc.target/sparc/vis3move-1.c b/gcc/testsuite/gcc.target/sparc/vis3move-1.c
new file mode 100644
index 0000000..1265d88
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vis3move-1.c
@@ -0,0 +1,29 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O1 -mvis3" } */
+
+double d;
+float f;
+
+int test_convert_from_float(void)
+{
+  return f;
+}
+
+int test_convert_from_double(void)
+{
+  return d;
+}
+
+float test_convert_to_float(int x)
+{
+  return x;
+}
+
+double test_convert_to_double(int x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times "movstouw\t%" 2 } } */
+/* { dg-final { scan-assembler-times "movwtos\t%" 2 } } */
diff --git a/gcc/testsuite/gcc.target/sparc/vis3move-2.c b/gcc/testsuite/gcc.target/sparc/vis3move-2.c
new file mode 100644
index 0000000..de79307
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vis3move-2.c
@@ -0,0 +1,29 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O1 -mvis3" } */
+
+double d;
+float f;
+
+long test_convert_from_float(void)
+{
+  return f;
+}
+
+long test_convert_from_double(void)
+{
+  return d;
+}
+
+float test_convert_to_float(long x)
+{
+  return x;
+}
+
+double test_convert_to_double(long x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times "movdtox\t%" 2 } } */
+/* { dg-final { scan-assembler-times "movxtod\t%" 2 } } */
diff --git a/gcc/testsuite/gcc.target/sparc/vis3move-3.c b/gcc/testsuite/gcc.target/sparc/vis3move-3.c
new file mode 100644
index 0000000..3b2116e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vis3move-3.c
@@ -0,0 +1,41 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O1 -mvis3" } */
+
+float fnegs (float a)
+{
+  return -a;
+}
+
+double fnegd (double a)
+{
+  return -a;
+}
+
+float fmuls (float a, float b)
+{
+  return a * b;
+}
+
+double fmuld (double a, double b)
+{
+  return a * b;
+}
+
+double fsmuld (float a, float b)
+{
+  return (double)a * (double)b;
+}
+
+double fnsmuld (float a, float b)
+{
+  return -((double)a * (double)b);
+}
+
+/* { dg-final { scan-assembler-times "movwtos\t%" 13 } } */
+/* { dg-final { scan-assembler "fnegs\t%" } } */
+/* { dg-final { scan-assembler "fnegd\t%" } } */
+/* { dg-final { scan-assembler "fmuls\t%" } } */
+/* { dg-final { scan-assembler "fmuld\t%" } } */
+/* { dg-final { scan-assembler "fsmuld\t%" } } */
+/* { dg-final { scan-assembler "fnsmuld\t%" } } */