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 Mon, Dec 8, 2008 at 8:59 AM, rajagopal, dwarak
<dwarak.rajagopal@amd.com> wrote:
>
>>
>> On Mon, Dec 8, 2008 at 8:00 AM, rajagopal, dwarak
>> <dwarak.rajagopal@amd.com> wrote:
>> >
>> >>
>> >> H.J. Lu wrote:
>> >> > On Wed, Dec 3, 2008 at 8:06 AM, H.J. Lu <hjl.tools@gmail.com>
> wrote:
>> >> >
>> >> >> On Wed, Dec 3, 2008 at 8:03 AM, rajagopal, dwarak
>> >> >> <dwarak.rajagopal@amd.com> wrote:
>> >> >>
>> >> >>>> Dwarak, can you based on the ideas in
>> >> >>>> immintrin.h
>> >> >>>> provide an implementation of x86intrin.h we can add to GCC?
>> >> >>>>
>> >> >>>>
>> >> >>> Attached is a patch that implements x86intrin.h. I'll add
>> >> "x86intrin.h"
>> >> >>> to gcc.target tests if this patch is Ok?
>> >> >>>
>> >> >>>
>> >> >> Why not just include <immintrin.h> for MMX, SSE, SSE2, SSE3,
> SSSE4
>> > and
>> >> AVX?
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> > Will this patch work?
>> >> >
>> >>
>> >> This patch is OK (with the ChangeLog) if there are no other
> objections
>> >> within 24h.
>> >>
>> >> Thanks,
>> >> Uros.
>> >>
>> >
>> > Hi Uros,
>> > Why do we need to add "immintrin.h" which contains all intrinsics
>> > supported by Intel, instead of having MMX, SSE, SSE2, SSE3, SSSE4
> and
>> > AVX in the x86intrin.h file? Why do we think this is a better
> approach
>> > than just including all the instruction set specific files in
>> > x86intrin.h? Isn't it simpler and clearer to have all the *intrin.h
>> > files included directly in x86intrin.h.
>> >
>>
>> Well, <immintrin.h> is required for AVX intrinsics, which is true for
> icc,
>> gcc
>> and MSVC. Since <immintrin.h> also supports MMX, SSE, SSE2, SSE3 and
>> SSSE4, we don't need to include other Xmmintrin.h individually.
>
> This might not be a good approach if in the future an architecture does
> not support all architectures extensions in immintrin.h. It is better to
> include Xmmintrin.h individually in that case.

If I understand it correctly, your concern is if future processors
from AMD and Intel implement one single
instruction extension, foobar, it is not certain where its intrinsic,
assuming both AMD and Intel specify the
same intrinsic for the same instruction, will be declared. If it is
declared in immintrin.h and immintrin.h is for Intel
ISA externsion only, gcc will have to declare it in a difference
header file for AMD. It has happened to popcnt
and we want to avoid it in the future. Am I correct?

> 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.


-- 
H.J.


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