[dpdk-dev] librte_eal: Fix wrong header file for old gcc version

Message ID 1440408177-29394-1-git-send-email-michael.qiu@intel.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

Michael Qiu Aug. 24, 2015, 9:22 a.m. UTC
  For __SSE3__, the corresponding header file should be pmmintrin.h,
tmmintrin.h works for __SSSE3__.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
 lib/librte_eal/common/include/arch/x86/rte_vect.h | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Thomas Monjalon Sept. 7, 2015, 2:44 p.m. UTC | #1
2015-08-24 17:22, Michael Qiu:
> For __SSE3__, the corresponding header file should be pmmintrin.h,
> tmmintrin.h works for __SSSE3__.

Please could you better explain the difference and what is exactly the bug
being fixed?
Thanks
  
Michael Qiu Sept. 25, 2015, 2:55 a.m. UTC | #2
On 2015/9/7 22:46, Thomas Monjalon wrote:
> 2015-08-24 17:22, Michael Qiu:
>> For __SSE3__, the corresponding header file should be pmmintrin.h,
>> tmmintrin.h works for __SSSE3__.
> Please could you better explain the difference and what is exactly the bug
> being fixed?
It should solve this issue:

[dpdk-dev] DPDK 2.1.0 build error: inlining failed in call to always_inline

/usr/lib/gcc/x86_64-redhat-linux/4.9.2/include/tmmintrin.h:185:1: error: inlining failed in call to always_inline ‘_mm_alignr_epi8’: t
arget specific option mismatch
 _mm_alignr_epi8(__m128i __X, __m128i __Y, const int __N)

 ^
The AMD cpu flags:

flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxe
xt fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni monitor cx16 popcnt lah
f_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt cpb hw_pstate npt lbrv svm_lock nrip_sa


"_mm_alignr_epi8" only works for ssse3 or upper,
but this AMD CPU does not support that. This function has been wrongly called, because the wrong header file.

Thanks,
Michael 


> Thanks
>
>
  
Michael Qiu Oct. 13, 2015, 6:25 a.m. UTC | #3
Hi, all

Any comments on this?

Thanks,
Michael
On 2015/9/25 10:56, Qiu, Michael wrote:
> On 2015/9/7 22:46, Thomas Monjalon wrote:
>> 2015-08-24 17:22, Michael Qiu:
>>> For __SSE3__, the corresponding header file should be pmmintrin.h,
>>> tmmintrin.h works for __SSSE3__.
>> Please could you better explain the difference and what is exactly the bug
>> being fixed?
> It should solve this issue:
>
> [dpdk-dev] DPDK 2.1.0 build error: inlining failed in call to always_inline
>
> /usr/lib/gcc/x86_64-redhat-linux/4.9.2/include/tmmintrin.h:185:1: error: inlining failed in call to always_inline ‘_mm_alignr_epi8’: t
> arget specific option mismatch
>  _mm_alignr_epi8(__m128i __X, __m128i __Y, const int __N)
>
>  ^
> The AMD cpu flags:
>
> flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxe
> xt fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni monitor cx16 popcnt lah
> f_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt cpb hw_pstate npt lbrv svm_lock nrip_sa
>
>
> "_mm_alignr_epi8" only works for ssse3 or upper,
> but this AMD CPU does not support that. This function has been wrongly called, because the wrong header file.
>
> Thanks,
> Michael 
>
>
>> Thanks
>>
>>
>
  
Bruce Richardson Oct. 13, 2015, 8:54 a.m. UTC | #4
On Mon, Aug 24, 2015 at 05:22:57PM +0800, Michael Qiu wrote:
> For __SSE3__, the corresponding header file should be pmmintrin.h,
> tmmintrin.h works for __SSSE3__.
> 
> Signed-off-by: Michael Qiu <michael.qiu@intel.com>

Since this is a bug-fix, it should probably have a fixes line in the commit.
Otherwise the change looks ok.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Thomas Monjalon Oct. 24, 2015, 8:35 p.m. UTC | #5
Please submit a v2 with complete git message including
compiler error, Fixes and Acked-by tags.
Thanks

2015-10-13 09:54, Bruce Richardson:
> On Mon, Aug 24, 2015 at 05:22:57PM +0800, Michael Qiu wrote:
> > For __SSE3__, the corresponding header file should be pmmintrin.h,
> > tmmintrin.h works for __SSSE3__.
> > 
> > Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> 
> Since this is a bug-fix, it should probably have a fixes line in the commit.
> Otherwise the change looks ok.
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  

Patch

diff --git a/lib/librte_eal/common/include/arch/x86/rte_vect.h b/lib/librte_eal/common/include/arch/x86/rte_vect.h
index b698797..8a4dace 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_vect.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_vect.h
@@ -51,6 +51,10 @@ 
 #endif
 
 #ifdef __SSE3__
+#include <pmmintrin.h>
+#endif
+
+#ifdef __SSSE3__
 #include <tmmintrin.h>
 #endif