This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] A new meta intrinsic header file for current and future x86 instrinsics.


On Wed, Dec 10, 2008 at 2:13 PM, rajagopal, dwarak
<dwarak.rajagopal@amd.com> wrote:
>> On Wed, Dec 10, 2008 at 8:24 AM, rajagopal, dwarak
>> <dwarak.rajagopal@amd.com> wrote:
>> >> > Why do we need to have different header files for the same
>> > instruction
>> >> > set with unnecessary duplication? If we had separate header files
>> >> > included in x86intrin.h file, we will not have this problem
> right?
>> >>
>> >> Is this the only concern you have? Please help me understand
>> >> your concerns by answering my question.
>> >
>> > This is one of our concerns and we would like this to be addressed.
>>
>> Can you list all of your concerns on immintrin.h? Thanks.
>>
>
> This is the only one we want to raise now and I'm really looking for an
> answer.
>
>> >>
>> >> > What do we gain from having immintrin.h file in gcc?
>> >> >
>> >> >> > Moreover, we can remove the requirement of having only
>> > immintrin.h
>> >> >> > including avxintrin.h (which is the patch Uros proposed -
>> >> >> > http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00186.html).
>> >> >> >
>> >> >>
>> >> >> As I said you must include <immintrin.h> for AVX intrinsic. This
>> >> >> requirement doesn't
>> >> >> come from gcc. It comes to gcc.
>> >> >
>> >> > Why do we have this requirement, that AVX intrinsic can be
> included
>> > only
>> >> > through immintrin.h?
>> >> >
>> >>
>> >> AVX intrinsics are defined by icc, which requires that
> <immintrin.h>
>> > has
>> >> to be included before using AVX intrinsics.
>> >>
>> >
>> > For ICC to be compatible with GCC, ICC will have to support
> x86intrin.h,
>> > so we really do not see why GCC should support an immintrin.h file
> that
>> > includes all ISAs that Intel processors support.
>> > ISAs that are common to AMD and Intel should all be visible directly
> in
>> > the x86intrin.h and not be hidden in an immintrin.h file.
>> >
>>
>> For AVX intrinsics, icc sets standard and we want gcc to be compatible
>> with icc on AVX support support since it is how users will use AVX
>> intrinsics.
>>
>
> I believe the SW developers will only include x86intrin.h in their code,
> thus the requirement to have support for immintrin.h in GCC is not
> needed. We do not have a problem with the fact that immintrin.h includes
> AVX intrinsics support. So the following in x86intrin.h makes sense to
> us:
>
> #ifdef __AVX__
> #include <immintrin.h> //adds AVX intrinsics to x86intrin.h
> #endif

That is fine without  #ifdef __AVX__/#endif. It is OK to include
<Xmmintrin.h> more than once.

> And include other header files that support MMX, SSE, SSE2, SSE3, SSE4,
> etc... directly inside x86intrin.h.
>
> We want to ensure that intrinsic header files supported by vendors other
> than Intel are in the main body of x86intrin.h, not under immintrin.h.



-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]