From a5bdd742c70ccd13a77fa48059ec7ed5a2c7b98e Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Sat, 5 Dec 2015 12:55:43 +0000 Subject: [PATCH] * gcc.target/powerpc/recip-sqrtf.c: New test. From-SVN: r231318 --- gcc/testsuite/ChangeLog | 4 ++++ .../gcc.target/powerpc/recip-sqrtf.c | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/recip-sqrtf.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 038c00353dc..d9b592a3771 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-12-05 David Edelsohn + + * gcc.target/powerpc/recip-sqrtf.c: New test. + 2015-12-04 Aditya Kumar Sebastian Pop diff --git a/gcc/testsuite/gcc.target/powerpc/recip-sqrtf.c b/gcc/testsuite/gcc.target/powerpc/recip-sqrtf.c new file mode 100644 index 00000000000..92798837e3e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/recip-sqrtf.c @@ -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 } } */ -- 2.30.2