* gcc.target/powerpc/recip-sqrtf.c: New test.
authorDavid Edelsohn <dje.gcc@gmail.com>
Sat, 5 Dec 2015 12:55:43 +0000 (12:55 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Sat, 5 Dec 2015 12:55:43 +0000 (07:55 -0500)
From-SVN: r231318

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/recip-sqrtf.c [new file with mode: 0644]

index 038c003..d9b592a 100644 (file)
@@ -1,3 +1,7 @@
+2015-12-05  David Edelsohn  <dje.gcc@gmail.com>
+
+       * gcc.target/powerpc/recip-sqrtf.c: New test.
+
 2015-12-04  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-sqrtf.c b/gcc/testsuite/gcc.target/powerpc/recip-sqrtf.c
new file mode 100644 (file)
index 0000000..9279883
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math -mcpu=power5 -mrecip" } */
+
+extern float sqrtf (float);
+
+float t1(float a, float b)
+{
+  return a/sqrtf(b);
+}
+
+float t2(float a, float b)
+{
+  return sqrtf(a/b);
+}
+
+float t3(float a)
+{
+  return sqrtf(a);
+}
+
+/* { dg-final { scan-assembler-times "frsqrtes" 3 } } */