From: "Qiu, Michael" <michael.qiu@intel.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] lib/librte_sched: Fix compile with gcc 4.3.4
Date: Fri, 27 Nov 2015 15:22:27 +0000 [thread overview]
Message-ID: <9C158339-F2EB-4D12-B9F9-498142F7692E@intel.com> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB97725836ACDB8A@irsmsx105.ger.corp.intel.com>
Sorry for not explaining clearly.
For gcc version start from version 4.4, x86intrin.h will be include, and inside x86intrin.h, immintrin.h will be directly include without check AVX (as I know, AVX is not exist when gcc >= 4.4),so no AVX macro does not mean vector disable.
Only gcc < 4.4 and no macro AVX will disable vector.
This is my understanding, may be wrong :)
Thanks,
Michael
> 在 2015年11月27日,下午10:09,Ananyev, Konstantin <konstantin.ananyev@intel.com> 写道:
>
>
>
>> -----Original Message-----
>> From: Qiu, Michael
>> Sent: Friday, November 27, 2015 2:02 PM
>> To: Ananyev, Konstantin
>> Cc: Thomas Monjalon; dev@dpdk.org
>> Subject: Re: [PATCH] lib/librte_sched: Fix compile with gcc 4.3.4
>>
>> I just replied that Marco AVX only exist in gcc version < 4.4 , otherwise it will not exist.
>
> If macro __AVX__ not defined, then
> #if defined(__AVX__)
> would always be false and SCHED_VECTOR_ENABLE also wouldn't be defined.
> So still don't understand why that is a problem
> Konstantin
>
>>
>> What's your suggest will not work if gcc version greater than 4.3.
>>
>> So still need to check gcc version. Any other solution?
>>
>> Thanks,
>> Michael
>>
>>> 在 2015年11月27日,下午8:34,Ananyev, Konstantin <konstantin.ananyev@intel.com> 写道:
>>>
>>>
>>>> -----Original Message-----
>>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiu, Michael
>>>> Sent: Friday, November 27, 2015 11:53 AM
>>>> To: Thomas Monjalon
>>>> Cc: dev@dpdk.org
>>>> Subject: Re: [dpdk-dev] [PATCH] lib/librte_sched: Fix compile with gcc 4.3.4
>>>>
>>>> really?I don't think so.
>>>>
>>>> AVX Marco only exist in the gcc version below 4.4, I still need to check if below or beyond 4.4 am I right?
>>>>
>>>> Thanks,
>>>> Michael
>>>
>>>
>>> If you look at lib/librte_eal/common/include/arch/x86/rte_vect.h, you'll see the code similar
>>> to one you are trying to put into rte_shed.c:
>>>
>>> lib/librte_eal/common/include/arch/x86/rte_vect.h:
>>> ...
>>> #if (defined(__ICC) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
>>>
>>> #ifdef __SSE__
>>> #include <xmmintrin.h>
>>> #endif
>>>
>>> #ifdef __SSE2__
>>> #include <emmintrin.h>
>>> #endif
>>>
>>> #ifdef __SSE3__
>>> #include <tmmintrin.h>
>>> #endif
>>>
>>> #if defined(__SSE4_2__) || defined(__SSE4_1__)
>>> #include <smmintrin.h>
>>> #endif
>>>
>>> #if defined(__AVX__)
>>> #include <immintrin.h>
>>> #endif
>>>
>>> #else
>>>
>>> #include <x86intrin.h>
>>>
>>> #endif
>>> ...
>>>
>>> So I think you can do just like that:
>>>
>>> #include <rte_vect.h>
>>> #if defined(__AVX__)
>>> #define SCHED_VECTOR_ENABLE
>>> #endif
>>>
>>> inside rte_sched.c
>>>
>>> Konstantin
>>>
>>>
>>>>
>>>>
>>>>> 在 2015年11月27日,下午5:01,Thomas Monjalon <thomas.monjalon@6wind.com> 写道:
>>>>>
>>>>> 2015-11-27 02:26, Qiu, Michael:
>>>>>>>> On 2015/11/27 5:29, Thomas Monjalon wrote:
>>>>>>>> 2015-11-26 18:49, Michael Qiu:
>>>>>>>> gcc 4.3.4 does not include "immintrin.h", and will post below error:
>>>>>>>> lib/librte_sched/rte_sched.c:56:23: error:
>>>>>>>> immintrin.h: No such file or directory
>>>>>>>>
>>>>>>>> To avoid this issue, a gcc version check is need and a flag to indicate
>>>>>>>> vector ablility.
>>>>>>> [...]
>>>>>>>> +#if (defined(__ICC) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
>>>>>>>> +
>>>>>>>> +#if defined(__AVX__)
>>>>>>>> #include <immintrin.h>
>>>>>>>> +#define SCHED_VECTOR_ENABLE
>>>>>>>> +#endif
>>>>>>>> +
>>>>>>>> +#else
>>>>>>>> +
>>>>>>>> +#include <x86intrin.h>
>>>>>>>> +#define SCHED_VECTOR_ENABLE
>>>>>>>> +
>>>>>>>> +#endif
>>>>>>> This kind of complication is managed by EAL.
>>>>>>> I think we should include rte_vect.h.
>>>>>>
>>>>>> As I know here it needs a flag to identify whether the platform support
>>>>>> AVX, if not it will not use it, so I don't know if we could only simply
>>>>>> include rte_vect.h?
>>>>>
>>>>> It's not exclusive.
>>>>> You can include rte_vect.h and check AVX to define SCHED_VECTOR_ENABLE.
>>>>>
next prev parent reply other threads:[~2015-11-27 15:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-26 10:49 Michael Qiu
2015-11-26 21:28 ` Thomas Monjalon
2015-11-27 2:26 ` Qiu, Michael
2015-11-27 8:59 ` Thomas Monjalon
2015-11-27 11:53 ` Qiu, Michael
2015-11-27 12:34 ` Ananyev, Konstantin
2015-11-27 14:01 ` Qiu, Michael
2015-11-27 14:09 ` Ananyev, Konstantin
2015-11-27 15:22 ` Qiu, Michael [this message]
2015-11-27 16:21 ` Ananyev, Konstantin
2015-12-02 2:09 ` [dpdk-dev] [PATCH v2] " Michael Qiu
2015-12-02 2:18 ` Thomas Monjalon
2015-12-02 2:29 ` Qiu, Michael
2015-12-02 2:39 ` [dpdk-dev] [PATCH v3] " Michael Qiu
2015-12-02 22:10 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9C158339-F2EB-4D12-B9F9-498142F7692E@intel.com \
--to=michael.qiu@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).