This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, testsuite, i386] AVX2 support for GCC
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Thu, 4 Aug 2011 11:50:18 +0200
- Subject: Re: [PATCH, testsuite, i386] AVX2 support for GCC
- References: <CAGs3RfvbcteBnqH=fTnj0aXFBZeS=iQ9MUrMazoLXHz0qHdCFA@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Aug 04, 2011 at 01:28:17PM +0400, Kirill Yukhin wrote:
> During last few months I was working on AVX2 support for GCC.
>
> Here is a patch which conforms (hopefully) to Spec which can be found at [1]
>
> I am attaching following files:
> - avx2.gcc.patch.tar.bz2. Compressed changes to GCC
Please be careful with the dejagnu feature tests:
+# Return 1 if avx2 instructions can be compiled.
+proc check_effective_target_avx2 { } {
+ return [check_no_compiler_messages avx2 object {
+ void _mm256_andnot_si256 (void)
+ {
+ long long x __attribute__ ((__vector_size__ (32)));
+ x = __builtin_ia32_andnotsi256 (x,x);
+ }
+ } "-O0 -mavx2" ]
+}
is using uninitialized variable. Much better to write it e.g. as
typedef long long __v4di __attribute__ ((__vector_size__ (32)));
__v4di
mm256_andnot_si256 (__v4di __X, __v4di __Y)
{
return __builtin_ia32_andnotsi256 (__X, __Y);
}
where no uninitialized vars are used, and the compiler can't really optimize
it away, nor attempt to simplify it (x & ~x is always 0, right?).
> - opt64.tmp.gcc.patch. Since we have exceeded number of possible keys
> in ix86_isa_flags this temporary patch allows AVX2 changes to work.
I don't think it is a good idea to bump the 31 check in the conditions
handling, that should be done only if the variable type is known to be
64-bit.
Jakub