From 89eed801461a906068634574b1cbb4bbf8a84ea9 Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Fri, 2 Aug 2019 16:04:14 +0000 Subject: [PATCH] simd_pcs_attribute.c: New test. 2019-08-02 Steve Ellcey * gcc.target/aarch64/simd_pcs_attribute.c: New test. * gcc.target/aarch64/simd_pcs_attribute-2.c: Ditto. * gcc.target/aarch64/simd_pcs_attribute-3.c: Ditto. From-SVN: r274020 --- gcc/testsuite/ChangeLog | 6 +++++ .../gcc.target/aarch64/simd_pcs_attribute-2.c | 16 +++++++++++++ .../gcc.target/aarch64/simd_pcs_attribute-3.c | 24 +++++++++++++++++++ .../gcc.target/aarch64/simd_pcs_attribute.c | 16 +++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c create mode 100644 gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-3.c create mode 100644 gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 45d941d7e6e..5d04531f699 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-08-02 Steve Ellcey + + * gcc.target/aarch64/simd_pcs_attribute.c: New test. + * gcc.target/aarch64/simd_pcs_attribute-2.c: Ditto. + * gcc.target/aarch64/simd_pcs_attribute-3.c: Ditto. + 2019-08-02 Uroš Bizjak PR target/91201 diff --git a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c new file mode 100644 index 00000000000..8eec6824f37 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast" } */ + +__attribute__ ((__simd__ ("notinbranch"))) +__attribute__ ((__nothrow__ , __leaf__ , __const__)) +extern double foo (double x); + +void bar(double * f, int n) +{ + int i; + for (i = 0; i < n; i++) + f[i] = foo(f[i]); +} + +/* { dg-final { scan-assembler-not {\.variant_pcs\tfoo} } } */ +/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnN2v_foo} 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-3.c b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-3.c new file mode 100644 index 00000000000..95f6a6803e8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-3.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast" } */ + +__attribute__ ((__simd__)) +__attribute__ ((__nothrow__ , __leaf__ , __const__)) +double foo (double x); + +void bar(double *f, int n) +{ + int i; + for (i = 0; i < n; i++) + f[i] = foo(f[i]); +} + +double foo(double x) +{ + return x * x / 3.0; +} + +/* { dg-final { scan-assembler-not {\.variant_pcs\tfoo} } } */ +/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnM1v_foo} 1 } } */ +/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnM2v_foo} 1 } } */ +/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnN1v_foo} 1 } } */ +/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnN2v_foo} 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute.c b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute.c new file mode 100644 index 00000000000..eddcef3597c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast" } */ + +__attribute__ ((__simd__ ("notinbranch"))) +__attribute__ ((__nothrow__ , __leaf__ , __const__)) +extern double log (double __x); + +void foo(double *f, int n) +{ + int i; + for (i = 0; i < n; i++) + f[i] = log(f[i]); +} + +/* { dg-final { scan-assembler-not {\.variant_pcs\tlog} } } */ +/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnN2v_log} 1 } } */ -- 2.30.2