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

H.J. Lu hjl.tools@gmail.com
Sat Nov 22 01:55:00 GMT 2008


On Fri, Nov 21, 2008 at 4:22 PM, Chris Lattner <clattner@apple.com> wrote:
> On Nov 21, 2008, at 4:20 PM, H.J. Lu wrote:
>>>>>
>>>>> So "immintrin.h" is defined as "the header you #include for AVX", not
>>>>> as
>>>>> "the header you #include to get current and future intel features"?
>>>>>
>>>>
>>>> What difference does it make?
>>>
>>> If AMD or another X86 vendor supports AVX some day, we need a header for
>>> AVX.  This header should be AVX only, not "random stuff intel has added
>>> in
>>> the last 10 years".
>>
>> Please take a look at what in gcc trunk today. The current structure
>> supports
>> it with a 2 line change.
>>
>>> This is exactly the situation with the xmmintrin.h headers.  What problem
>>> are you trying to solve by deviating from the standard and established
>>> practice?
>>
>> The standard and established practice is to add a new
>> Xmmintrin.h, which is immintrin.h, for a new ISA extension.
>
> If your answer to the previous question is "immintrin.h is the header for
> AVX, and when we add new [non-"AVX 1"] stuff to the ISA it won't go in
> immintrin.h" then I have no objection to adding immintrin.h.
>

Let me clarify a few things:

1. We didn't add a new file. We just renamed gmmintrin.h to
immintrin.h.
2. Including <immintrin.h> itself doesn't enable any ISA extensions.
3. You need to use -mXXX to get the XXX extension from
<immintrin.h>. It applies to -mmmx, -msse, ... -mavx.
4. We will add future new ISA intrinics to a new header file
and include it from <immintrin.h>.

You can enable any suitable sets of current and future ISA
extensions by including <immintrin.h> and proper combinations
of -mXXX.

No, -mavx -msse5 will be disallowed:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38201


-- 
H.J.



More information about the Gcc-patches mailing list