Skip to content

Commit f30e180

Browse files
author
Richard Earnshaw
committed
arm: testsuite: fix vect-fmaxmin.c test
This is another case of a test that was both an executable test requiring specific hardware and an assembler scan test. The requirement for the hardware was masking some useful testing that could be done (by scanning the assembly output) on almost all test runs. Fixed in a similar manner to fmaxmin{,-2}.c by splitting the test into two, one that scans the assembler output and one that executes the compiled code if suitable hardware is available. The masked issue was that this test was expecting vectorization to occur that was incorrect given the options passed. For correct vectorization we need -funsafe-math-optimizations as the vector version of the single-precision operation will apply a truncation of denormal values. gcc/testsuite/ChangeLog: * gcc.target/arm/vect-fmaxmin-2.c: New compile test. Split from ... * gcc.target/arm/vect-fmaxmin.c: ... here. Remove scan-assembler subtests. For both, add -funsafe-math-optimizations.
1 parent f3899e0 commit f30e180

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* { dg-do compile } */
2+
/* { dg-require-effective-target arm_arch_v8a_hard_ok } */
3+
/* { dg-options "-O2 -ftree-vectorize -funsafe-math-optimizations -fno-inline -save-temps" } */
4+
/* { dg-add-options arm_arch_v8a_hard } */
5+
6+
#include "fmaxmin.x"
7+
8+
/* { dg-final { scan-assembler-times "vmaxnm.f32\tq\[0-9\]+, q\[0-9\]+, q\[0-9\]+" 1 } } */
9+
/* { dg-final { scan-assembler-times "vminnm.f32\tq\[0-9\]+, q\[0-9\]+, q\[0-9\]+" 1 } } */
10+
11+
/* NOTE: There are no double precision vector versions of vmaxnm/vminnm. */
12+
/* { dg-final { scan-assembler-times "vmaxnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */
13+
/* { dg-final { scan-assembler-times "vminnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */
14+
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
/* { dg-do run } */
22
/* { dg-require-effective-target arm_v8_neon_hw } */
3-
/* { dg-options "-O2 -ftree-vectorize -fno-inline -march=armv8-a -save-temps" } */
3+
/* { dg-options "-O2 -ftree-vectorize -fno-inline -funsafe-math-optimizations" } */
44
/* { dg-add-options arm_v8_neon } */
55

66
#include "fmaxmin.x"
7-
8-
/* { dg-final { scan-assembler-times "vmaxnm.f32\tq\[0-9\]+, q\[0-9\]+, q\[0-9\]+" 1 } } */
9-
/* { dg-final { scan-assembler-times "vminnm.f32\tq\[0-9\]+, q\[0-9\]+, q\[0-9\]+" 1 } } */
10-
11-
/* NOTE: There are no double precision vector versions of vmaxnm/vminnm. */
12-
/* { dg-final { scan-assembler-times "vmaxnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */
13-
/* { dg-final { scan-assembler-times "vminnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */
14-

0 commit comments

Comments
 (0)