Skip to contentSkip to conversation

eal: fix undeclared function error on old CPUs

PATCH Applied Andre Muezerie 3 participants 3 messages Jan 14, 2025 – Jan 23, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: fix undeclared function error on old CPUs

Error reported:
../lib/net/net_crc_sse.c:49:17: error: call to undeclared function '_mm_clmulepi64_si128'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

The fix is to remove the unnecessary ifdef around the inclusion of header file immintrin.h. This header also contains functions that do not require AVX instructions, so should not be included only when AVX is available.

Bugzilla ID: 1595

Fixes da826b7135a4 ("eal: introduce ymm type for AVX 256-bit")
---
 lib/eal/x86/include/rte_vect.h | 2 --
 1 file changed, 2 deletions(-)
lib/eal/x86/include/rte_vect.h +0 -2
index 5ac3ccfd82..5fdcd632ac 100644
@@ -19,9 +19,7 @@
 
 #if defined(__ICC) || defined(_WIN64)
 #include <smmintrin.h> /* SSE4 */
-#if defined(__AVX__)
 #include <immintrin.h>
-#endif
 #else
 #include <x86intrin.h>
 #endif
Signature · 1 line
2.47.0.vfs.0.3
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Andre Muezerie

Error reported:
../lib/net/net_crc_sse.c:49:17: error: call to undeclared function '_mm_clmulepi64_si128'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

The fix is to remove the unnecessary ifdef around the inclusion of header file immintrin.h. This header also contains functions that do not require AVX instructions, so should not be included only when AVX is available.

Quoted 6 lines

Bugzilla ID: 1595

Fixes da826b7135a4 ("eal: introduce ymm type for AVX 256-bit")

---

Quoted 20 lines
 lib/eal/x86/include/rte_vect.h | 2 --
 1 file changed, 2 deletions(-)
lib/eal/x86/include/rte_vect.h +0 -2
index 5ac3ccfd82..5fdcd632ac 100644
@@ -19,9 +19,7 @@
 
 #if defined(__ICC) || defined(_WIN64)
 #include <smmintrin.h> /* SSE4 */
-#if defined(__AVX__)
 #include <immintrin.h>
-#endif
 #else
 #include <x86intrin.h>
 #endif
Signature · 1 line
2.47.0.vfs.0.3
#2 lore raw
Quoted 12 lines · Bruce Richardson
Quoted 10 lines · Andre Muezerie

Error reported:
../lib/net/net_crc_sse.c:49:17: error: call to undeclared function '_mm_clmulepi64_si128'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

The fix is to remove the unnecessary ifdef around the inclusion of header file immintrin.h. This header also contains functions that do not require AVX instructions, so should not be included only when AVX is available.

Quoted 4 lines
Quoted 4 lines

Bugzilla ID: 1595

Fixes da826b7135a4 ("eal: introduce ymm type for AVX 256-bit")
Quoted 2 lines
Quoted 1 line

Applied, thanks Andre.

Signature · 1 line
David Marchand