Skip to contentSkip to conversation

librte_eal: Fix wrong header file for old gcc version

PATCH In review Michael Qiu 3 participants 6 messages Aug 24, 2015 – Oct 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 librte_eal: Fix wrong header file for old gcc version

For __SSE3__, the corresponding header file should be pmmintrin.h, tmmintrin.h works for __SSSE3__.

---
 lib/librte_eal/common/include/arch/x86/rte_vect.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/librte_eal/common/include/arch/x86/rte_vect.h +4 -0
index b698797..8a4dace 100644
@@ -51,6 +51,10 @@
 #endif
 
 #ifdef __SSE3__
+#include <pmmintrin.h>
+#endif
+
+#ifdef __SSSE3__
 #include <tmmintrin.h>
 #endif
 
Signature · 1 line
1.9.3
#1 lore raw

2015-08-24 17:22, Michael Qiu:

Quoted 2 lines

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

#2 lore raw
Quoted 5 lines · Thomas Monjalon

2015-08-24 17:22, Michael Qiu:

Quoted 2 lines

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

Quoted 3 lines

Thanks

#3 lore raw

Hi, all

Any comments on this?

Thanks,
Michael

Quoted 33 lines · Michael
Quoted 5 lines · Thomas Monjalon

2015-08-24 17:22, Michael Qiu:

Quoted 2 lines

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

Quoted 3 lines

Thanks

#5 lore raw

Please submit a v2 with complete git message including compiler error, Fixes and Acked-by tags. Thanks

2015-10-13 09:54, Bruce Richardson:

Quoted 10 lines · Michael Qiu
Quoted 4 lines

For __SSE3__, the corresponding header file should be pmmintrin.h, tmmintrin.h works for __SSSE3__.

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