diff options
author | Matthew Gretton-Dann <mgretton@gcc.gnu.org> | 2012-07-05 09:10:29 +0000 |
---|---|---|
committer | Matthew Gretton-Dann <mgretton@gcc.gnu.org> | 2012-07-05 09:10:29 +0000 |
commit | 12c0399e136f1e56d6437fff5cd6e01f5f7ec284 (patch) | |
tree | 3dbe322c20b05dc50df01c683fc468f020cdc211 | |
parent | 76f722f45208538637e8d3c3d5ea0717b3bcdf8b (diff) | |
download | gcc-12c0399e136f1e56d6437fff5cd6e01f5f7ec284.zip gcc-12c0399e136f1e56d6437fff5cd6e01f5f7ec284.tar.gz gcc-12c0399e136f1e56d6437fff5cd6e01f5f7ec284.tar.bz2 |
Add files forgotten in last commit (ChangeLog has them already):
gcc/testsuite:
* gcc.target/arm/fma.c: New testcase.
* gcc.target/arm/fma.h: Likewise.
* gcc.target/arm/fma-sp.c: Likewise.
From-SVN: r189284
-rw-r--r-- | gcc/testsuite/gcc.target/arm/fma-sp.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/fma.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/fma.h | 50 |
3 files changed, 76 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/fma-sp.c b/gcc/testsuite/gcc.target/arm/fma-sp.c new file mode 100644 index 0000000..457b55c --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/fma-sp.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb" } */ + +#include "fma.h" + +/* { dg-final { scan-assembler-not "vfma\.f64\td\[0-9\]" } } */ +/* { dg-final { scan-assembler-times "vfma\.f32\ts\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-not "vfms\.f64\td\[0-9\]" } } */ +/* { dg-final { scan-assembler-times "vfms\.f32\ts\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-not "vfnma\.f64\td\[0-9\]" } } */ +/* { dg-final { scan-assembler-times "vfnma\.f32\ts\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-not "vfnms\.f64\td\[0-9\]" } } */ +/* { dg-final { scan-assembler-times "vfnms\.f32\ts\[0-9\]" 1 } } */ diff --git a/gcc/testsuite/gcc.target/arm/fma.c b/gcc/testsuite/gcc.target/arm/fma.c new file mode 100644 index 0000000..1809aa8 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/fma.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mcpu=cortex-a15 -mfpu=vfpv4" } */ + +#include "fma.h" + +/* { dg-final { scan-assembler-times "vfma\.f64\td\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "vfma\.f32\ts\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "vfms\.f64\td\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "vfms\.f32\ts\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "vfnma\.f64\td\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "vfnma\.f32\ts\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "vfnms\.f64\td\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "vfnms\.f32\ts\[0-9\]" 1 } } */ diff --git a/gcc/testsuite/gcc.target/arm/fma.h b/gcc/testsuite/gcc.target/arm/fma.h new file mode 100644 index 0000000..0812c2d --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/fma.h @@ -0,0 +1,50 @@ +extern double fma (double, double, double); +extern float fmaf (float, float, float); + +float +vfma32 (float x, float y, float z) +{ + return fmaf (x, y, z); +} + +float +vfms32 (float x, float y, float z) +{ + return fmaf (-x, y, z); +} + +float +vfnms32 (float x, float y, float z) +{ + return fmaf (x, y, -z); +} + +float +vfnma32 (float x, float y, float z) +{ + return fmaf (-x, y, -z); +} + +double +vfma64 (double x, double y, double z) +{ + return fma (x, y, z); +} + +double +vfms64 (double x, double y, double z) +{ + return fma (-x, y, z); +} + +double +vfnms64 (double x, double y, double z) +{ + return fma (x, y, -z); +} + +double +vfnma64 (double x, double y, double z) +{ + return fma (-x, y, -z); +} |