This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, VECTOR ABI] Add __attribute__((__simd__)) to GCC.
- From: Kirill Yukhin <kirill dot yukhin at gmail dot com>
- To: Andreas Schwab <schwab at suse dot de>, David Edelsohn <dje dot gcc at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, Jeff Law <law at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Nov 2015 17:11:07 +0300
- Subject: Re: [PATCH, VECTOR ABI] Add __attribute__((__simd__)) to GCC.
- Authentication-results: sourceware.org; auth=none
- References: <20151023141102 dot GA63293 at msticlxl57 dot ims dot intel dot com> <alpine dot DEB dot 2 dot 10 dot 1510231414210 dot 11051 at digraph dot polyomino dot org dot uk> <20151027140655 dot GC46998 at msticlxl57 dot ims dot intel dot com> <20151027141505 dot GG478 at tucnak dot redhat dot com> <20151028091601 dot GA53647 at msticlxl57 dot ims dot intel dot com> <20151029085447 dot GP478 at tucnak dot redhat dot com> <20151110084414 dot GA62112 at msticlxl57 dot ims dot intel dot com> <20151110085804 dot GW5675 at tucnak dot redhat dot com> <20151113115430 dot GA63972 at msticlxl57 dot ims dot intel dot com> <mvmy4dvr67g dot fsf at hawking dot suse dot de>
Hello Andreas, Devid.
On 18 Nov 10:45, Andreas Schwab wrote:
> Kirill Yukhin <kirill.yukhin@gmail.com> writes:
>
> > diff --git a/gcc/testsuite/c-c++-common/attr-simd.c b/gcc/testsuite/c-c++-common/attr-simd.c
> > new file mode 100644
> > index 0000000..b4eda34
> > --- /dev/null
> > +++ b/gcc/testsuite/c-c++-common/attr-simd.c
> > @@ -0,0 +1,32 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "-fdump-tree-optimized" } */
> > +
> > +__attribute__((__simd__))
> > +extern
> > +int simd_attr (void)
> > +{
> > + return 0;
> > +}
> > +
> > +/* { dg-final { scan-tree-dump "simd_attr\[ \\t\]simdclone|vector" "optimized" } } */
>
> On ia64:
>
> FAIL: c-c++-common/attr-simd.c -Wc++-compat scan-tree-dump optimized "simd_attr[ \\t]simdclone|vector"
> FAIL: c-c++-common/attr-simd.c -Wc++-compat scan-tree-dump optimized "simd_attr2[ \\t]simdclone|vector"
>
> $ grep simd_attr attr-simd.c.194t.optimized
> ;; Function simd_attr (simd_attr, funcdef_no=0, decl_uid=1389, cgraph_uid=0, symbol_order=0)
> simd_attr ()
> ;; Function simd_attr2 (simd_attr2, funcdef_no=1, decl_uid=1392, cgraph_uid=1, symbol_order=1)
> simd_attr2 ()
As far as vABI is supported on x86_64/i?86 only, I am going to enable mentioned `scan-tree-dump' only
for these targets. This should cure both IA64 and Power.
Concerning attr-simd-3.c. It is known issue: PR68158.
And I believe this test should work everywhere as far as PR is resolved.
I'll put xfail into the test.
Which will lead to (in g++.log):
gcc/testsuite/c-c++-common/attr-simd-3.c:5:48: warning: '__simd__' attribute does not apply to types\
[-Wattributes]^M
output is:
gcc/testsuite/c-c++-common/attr-simd-3.c:5:48: warning: '__simd__' attribute does not apply to types\
[-Wattributes]^M
XFAIL: c-c++-common/attr-simd-3.c -std=gnu++98 PR68158 (test for errors, line 5)
FAIL: c-c++-common/attr-simd-3.c -std=gnu++98 (test for excess errors)
Excess errors:
gcc/testsuite/c-c++-common/attr-simd-3.c:5:48: warning: '__simd__' attribute does not apply to types\
[-Wattributes]
Patch in the bottom.
gcc/tessuite/
* c-c++-common/attr-simd-3.c: Put xfail (PR68158) on dg-error.
* c-c++-common/attr-simd.c: Limit scan of dump to x86_64/i?86.
>
> Andreas.
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
diff --git a/gcc/testsuite/c-c++-common/attr-simd-3.c b/gcc/testsuite/c-c++-common/attr-simd-3.c
index 2bbdf04..35dd4c0 100644
--- a/gcc/testsuite/c-c++-common/attr-simd-3.c
+++ b/gcc/testsuite/c-c++-common/attr-simd-3.c
@@ -2,4 +2,4 @@
/* { dg-options "-fcilkplus" } */
/* { dg-prune-output "undeclared here \\(not in a function\\)|\[^\n\r\]* was not declared in this scope" } */
-void f () __attribute__((__simd__, __vector__)); /* { dg-error "in the same function marked as a Cilk Plus" } */
+void f () __attribute__((__simd__, __vector__)); /* { dg-error "in the same function marked as a Cilk Plus" "PR68158" { xfail c++ } } */
diff --git a/gcc/testsuite/c-c++-common/attr-simd.c b/gcc/testsuite/c-c++-common/attr-simd.c
index 61974e3..7674588 100644
--- a/gcc/testsuite/c-c++-common/attr-simd.c
+++ b/gcc/testsuite/c-c++-common/attr-simd.c
@@ -11,7 +11,7 @@ int simd_attr (void)
return 0;
}
-/* { dg-final { scan-tree-dump "simd_attr\[ \\t\]simdclone|vector" "optimized" } } */
+/* { dg-final { scan-tree-dump "simd_attr\[ \\t\]simdclone|vector" "optimized" { target { i?86-*-* x86_64-*-* } } } } */
/* { dg-final { scan-assembler-times "_ZGVbN4_simd_attr:" 1 { target { i?86-*-* x86_64-*-* } } } } */
/* { dg-final { scan-assembler-times "_ZGVbM4_simd_attr:" 1 { target { i?86-*-* x86_64-*-* } } } } */
/* { dg-final { scan-assembler-times "_ZGVcN4_simd_attr:" 1 { target { i?86-*-* x86_64-*-* } } } } */
@@ -29,7 +29,7 @@ int simd_attr2 (void)
return 0;
}
-/* { dg-final { scan-tree-dump "simd_attr2\[ \\t\]simdclone|vector" "optimized" } } */
+/* { dg-final { scan-tree-dump "simd_attr2\[ \\t\]simdclone|vector" "optimized" { target { i?86-*-* x86_64-*-* } } } } */
/* { dg-final { scan-assembler-times "_ZGVbN4_simd_attr2:" 1 { target { i?86-*-* x86_64-*-* } } } } */
/* { dg-final { scan-assembler-times "_ZGVbM4_simd_attr2:" 1 { target { i?86-*-* x86_64-*-* } } } } */
/* { dg-final { scan-assembler-times "_ZGVcN4_simd_attr2:" 1 { target { i?86-*-* x86_64-*-* } } } } */