Skip to contentSkip to conversation

buildtools: Check GCC version to avoid GCC 6.3.0 avx512 bug

PATCH In review Liang Ma 4 participants 15 messages Jul 17, 2021 – Jul 22, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore

Liang Ma

author
#0 lore raw

PATCH 1/1 buildtools: Check GCC version to avoid GCC 6.3.0 avx512 bug

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which casue building failure with debug buildtype.

Therefore, it's helpful to disable avx512 for GCC 6.3.0

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
---
 buildtools/binutils-avx512-check.sh | 7 +++++++
 1 file changed, 7 insertions(+)
buildtools/binutils-avx512-check.sh +7 -0
index 2a833b64b7..b86d0b179e 100755
@@ -5,6 +5,13 @@
 AS=${AS:-as}
 OBJFILE=$(mktemp -t dpdk.binutils-check.XXXXXX)
 trap 'rm -f "$OBJFILE"' EXIT
+
+# from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
+GCC_VER=6.3.0
+gcc --version|grep $GCC_VER && {
+    echo "GCC 6.3.0 is broken with  _mm512_extracti64x4_epi64"
+    exit 1
+}
 # from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028
 GATHER_PARAMS='0x8(,%ymm1,1),%ymm0{%k2}'
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 10 lines · On Sat, 17 Jul 2021 18:08:30 +0100 Liang Ma <[email protected]> wrote:

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which casue building failure with debug buildtype.

Therefore, it's helpful to disable avx512 for GCC 6.3.0

Quoted 8 lines

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)

What distro still has GCC 6.3.0?

author
#2 lore raw
Quoted 19 lines · Stephen Hemminger
Quoted 16 lines · On Sat, 17 Jul 2021 18:08:30 +0100 Liang Ma <[email protected]> wrote:

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which casue building failure with debug buildtype.

Therefore, it's helpful to disable avx512 for GCC 6.3.0

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
Quoted 4 lines
Quoted 2 lines

What distro still has GCC 6.3.0?

For example Debian 9.x

#3 lore raw
Quoted 20 lines · On Sat, 17 Jul 2021 23:13:04 +0100 Liang Ma <[email protected]> wrote:
Quoted 19 lines · Stephen Hemminger
Quoted 16 lines · On Sat, 17 Jul 2021 18:08:30 +0100 Liang Ma <[email protected]> wrote:

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which casue building failure with debug buildtype.

Therefore, it's helpful to disable avx512 for GCC 6.3.0

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

What distro still has GCC 6.3.0?

For example Debian 9.x

Ok, thanks. Is there a bug fix in Debian LTS yet?

author
#4 lore raw
Quoted 23 lines · Stephen Hemminger
Quoted 20 lines · On Sat, 17 Jul 2021 23:13:04 +0100 Liang Ma <[email protected]> wrote:
Quoted 19 lines · Stephen Hemminger
Quoted 16 lines · On Sat, 17 Jul 2021 18:08:30 +0100 Liang Ma <[email protected]> wrote:

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which casue building failure with debug buildtype.

Therefore, it's helpful to disable avx512 for GCC 6.3.0

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

What distro still has GCC 6.3.0?

For example Debian 9.x

Ok, thanks. Is there a bug fix in Debian LTS yet?

I look into https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887, and find gcc community has no plan to backport fix. Hence, I don't think Debian LTS will have any fix for this. That's why I send out this patch.

#5 lore raw
Quoted 27 lines · Liang Ma
Quoted 26 lines · Stephen Hemminger
Quoted 23 lines · On Sat, 17 Jul 2021 23:13:04 +0100 Liang Ma <[email protected]> wrote:
Quoted 22 lines · Stephen Hemminger
Quoted 18 lines · On Sat, 17 Jul 2021 18:08:30 +0100 Liang Ma <[email protected]> wrote:

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which casue building failure with debug buildtype.

Therefore, it's helpful to disable avx512 for GCC 6.3.0

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

What distro still has GCC 6.3.0?

For example Debian 9.x

Ok, thanks. Is there a bug fix in Debian LTS yet?

I look into https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887, and find gcc community has no plan to backport fix. Hence, I don't think Debian LTS will have any fix for this. That's why I send out this patch.

Thanks for the report. However, rather than just disabling based on version number, can we instead use a compile-time check for broken compiler. This is what we did previously for other similar issues and it works better because:
* removes the possibility of us missing a broken compiler version
* takes account of the possibility of a fix backport (even if we don't expect one, it's best not to count it out)

Looking at the bug report, it seems this issue could be detected directly in meson using "cc.compiles" and the code snippet from the report.

Regards,
/Bruce

author
#6 lore raw
Quoted 44 lines · Bruce Richardson
Quoted 27 lines · Liang Ma
Quoted 26 lines · Stephen Hemminger
Quoted 23 lines · On Sat, 17 Jul 2021 23:13:04 +0100 Liang Ma <[email protected]> wrote:
Quoted 22 lines · Stephen Hemminger
Quoted 18 lines · On Sat, 17 Jul 2021 18:08:30 +0100 Liang Ma <[email protected]> wrote:

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which casue building failure with debug buildtype.

Therefore, it's helpful to disable avx512 for GCC 6.3.0

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

What distro still has GCC 6.3.0?

For example Debian 9.x

Ok, thanks. Is there a bug fix in Debian LTS yet?

I look into https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887, and find gcc community has no plan to backport fix. Hence, I don't think Debian LTS will have any fix for this. That's why I send out this patch.

Thanks for the report. However, rather than just disabling based on version number, can we instead use a compile-time check for broken compiler. This is what we did previously for other similar issues and it works better because:
* removes the possibility of us missing a broken compiler version
* takes account of the possibility of a fix backport (even if we don't expect one, it's best not to count it out)

Quoted 5 lines

Looking at the bug report, it seems this issue could be detected directly in meson using "cc.compiles" and the code snippet from the report.

Regards,
/Bruce

Many thanks for the suggestion. I will rework the patch with the suggested solution.

author
#7 lore raw

PATCH v2 1/1 build: check AVX512 rather than compiler version

In reply to Liang Ma

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype.

Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6.

This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512.

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
---
 config/x86/meson.build | 13 +++++++++++++
 1 file changed, 13 insertions(+)
config/x86/meson.build +13 -0
index b9348c44de..77370a91f7 100644
@@ -10,6 +10,19 @@ if not is_windows
     endif
 endif
 
+#check if compiler is working with _mm512_extracti64x4_epi64
+#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
+if not is_windows
+    code = '''#include <immintrin.h>
+    void test(__m512i zmm){
+        __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}'''
+    result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking')
+    if result == false and cc.has_argument('-mno-avx512f')
+        machine_args += '-mno-avx512f'
+        warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support')
+    endif
+endif
+
 # we require SSE4.2 for DPDK
 if cc.get_define('__SSE4_2__', args: machine_args) == ''
     message('SSE 4.2 not enabled by default, explicitly enabling')
Signature · 1 line
2.17.1
#8 lore raw

Re: [dpdk-dev] [PATCH v2] build: check AVX512 rather than compiler version

Quoted 15 lines · Liang Ma

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype.

Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6.

This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512.

Bugzilla ID: 717

Quoted 8 lines
Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)

---

Looks generally ok, but some comments below.

Quoted 8 lines
 config/x86/meson.build | 13 +++++++++++++
 1 file changed, 13 insertions(+)
config/x86/meson.build +0 -0
index b9348c44de..77370a91f7 100644

config/x86/meson.build if not is_windows · line 15

Quoted 6 lines
config/x86/meson.build +3 -0
@@ -10,6 +10,19 @@ if not is_windows
     endif
 endif
 
+#check if compiler is working with _mm512_extracti64x4_epi64
+#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
+if not is_windows

Don't think this is needed here. The reason for it in the previous check for avx512 is because that check is done by a shell script which won't work on windows. Since we use meson functions for this check, it will work anywhere.

config/x86/meson.build if not is_windows · line 20

Quoted 5 lines
config/x86/meson.build +5 -0
+    code = '''#include <immintrin.h>
+    void test(__m512i zmm){
+        __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}'''
+    result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking')
+    if result == false and cc.has_argument('-mno-avx512f')

Rather than checking for -mno-avx512f here, the whole block should probably be in an avx512 block itself. If the compiler doesn't have the "-mavx512f" flag, there may be problems with the "cc.compiles" command (or maybe it just counts as an error case?).

I'd suggest changing the "is_windows" condition to a cc.has_argument() one for avx512.

Quoted 11 lines
config/x86/meson.build +5 -0
+        machine_args += '-mno-avx512f'
+        warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support')
+    endif
+endif
+
 # we require SSE4.2 for DPDK
 if cc.get_define('__SSE4_2__', args: machine_args) == ''
     message('SSE 4.2 not enabled by default, explicitly enabling')
Signature · 1 line
2.17.1
author
#9 lore raw

Re: [dpdk-dev] [PATCH v2] build: check AVX512 rather than compiler version

Quoted 53 lines · Bruce Richardson
Quoted 15 lines · Liang Ma

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype.

Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6.

This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512.

Bugzilla ID: 717

Quoted 8 lines
Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)

---

Looks generally ok, but some comments below.

Quoted 8 lines
 config/x86/meson.build | 13 +++++++++++++
 1 file changed, 13 insertions(+)
config/x86/meson.build +0 -0
index b9348c44de..77370a91f7 100644

config/x86/meson.build if not is_windows · line 15

Quoted 6 lines
config/x86/meson.build +3 -0
@@ -10,6 +10,19 @@ if not is_windows
     endif
 endif
 
+#check if compiler is working with _mm512_extracti64x4_epi64
+#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
+if not is_windows

Don't think this is needed here. The reason for it in the previous check for avx512 is because that check is done by a shell script which won't work on windows. Since we use meson functions for this check, it will work anywhere.

config/x86/meson.build if not is_windows · line 20

Quoted 5 lines
config/x86/meson.build +5 -0
+    code = '''#include <immintrin.h>
+    void test(__m512i zmm){
+        __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}'''
+    result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking')
+    if result == false and cc.has_argument('-mno-avx512f')
Quoted 7 lines

Rather than checking for -mno-avx512f here, the whole block should probably be in an avx512 block itself. If the compiler doesn't have the "-mavx512f" flag, there may be problems with the "cc.compiles" command (or maybe it just counts as an error case?).

I'd suggest changing the "is_windows" condition to a cc.has_argument() one for avx512.

agree, I will fix that on v3.

Quoted 12 lines
Quoted 12 lines
config/x86/meson.build +5 -0
+        machine_args += '-mno-avx512f'
+        warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support')
+    endif
+endif
+
 # we require SSE4.2 for DPDK
 if cc.get_define('__SSE4_2__', args: machine_args) == ''
     message('SSE 4.2 not enabled by default, explicitly enabling')
Signature · 1 line
2.17.1
author
#10 lore raw

PATCH v3 1/1 build: check AVX512 rather than compiler version

In reply to Liang Ma

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype.

Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6.

This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512.

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
---
 config/x86/meson.build | 13 +++++++++++++
 1 file changed, 13 insertions(+)
config/x86/meson.build +13 -0
index b9348c44de..87b051cd2d 100644
@@ -10,6 +10,19 @@ if not is_windows
     endif
 endif
 
+#check if compiler is working with _mm512_extracti64x4_epi64
+#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
+if cc.has_argument('-mavx512f')
+    code = '''#include <immintrin.h>
+    void test(__m512i zmm){
+        __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}'''
+    result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking')
+    if result == false
+        machine_args += '-mno-avx512f'
+        warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support')
+    endif
+endif
+
 # we require SSE4.2 for DPDK
 if cc.get_define('__SSE4_2__', args: machine_args) == ''
     message('SSE 4.2 not enabled by default, explicitly enabling')
Signature · 1 line
2.17.1
Acked-by on v3 1/1
#11 lore raw

Re: [dpdk-dev] [PATCH v3] build: check AVX512 rather than compiler version

Quoted 15 lines · Liang Ma

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype.

Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6.

This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512.

Bugzilla ID: 717

Quoted 8 lines
Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)

---

One minor comment below. Also the commit title needs rewording, since the current title is based on the changes from V1->V2 of your patch. I'd suggest something like:
"build: check for broken AVX-512 compiler support"

With fixed title:

Quoted 9 lines
 config/x86/meson.build | 13 +++++++++++++
 1 file changed, 13 insertions(+)
config/x86/meson.build +0 -0
index b9348c44de..87b051cd2d 100644
@@ -10,6 +10,19 @@ if not is_windows
     endif

config/x86/meson.build if not is_windows · line 20

Quoted 10 lines
config/x86/meson.build +8 -0
 endif
 
+#check if compiler is working with _mm512_extracti64x4_epi64
+#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
+if cc.has_argument('-mavx512f')
+    code = '''#include <immintrin.h>
+    void test(__m512i zmm){
+        __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}'''
+    result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking')
+    if result == false

You can get rid of the "result" variable and just do

	if not cc.compiles(...)

It might be a little more readable.

Quoted 11 lines
config/x86/meson.build +5 -0
+        machine_args += '-mno-avx512f'
+        warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support')
+    endif
+endif
+
 # we require SSE4.2 for DPDK
 if cc.get_define('__SSE4_2__', args: machine_args) == ''
     message('SSE 4.2 not enabled by default, explicitly enabling')
Signature · 1 line
2.17.1
author
#12 lore raw

Re: [dpdk-dev] [PATCH v3] build: check AVX512 rather than compiler version

Quoted 8 lines · Bruce Richardson

One minor comment below. Also the commit title needs rewording, since the current title is based on the changes from V1->V2 of your patch. I'd suggest something like:
"build: check for broken AVX-512 compiler support"

With fixed title:

Thanks. I will send out V4 to address that.

author
#13 lore raw

PATCH v4 1/1 build: check for broken AVX-512 compiler support

In reply to Liang Ma

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype.

Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6.

This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512.

Bugzilla ID: 717

Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
---
 config/x86/meson.build | 13 +++++++++++++
 1 file changed, 13 insertions(+)
config/x86/meson.build +13 -0
index b9348c44de..87b051cd2d 100644
@@ -10,6 +10,19 @@ if not is_windows
     endif
 endif
 
+#check if compiler is working with _mm512_extracti64x4_epi64
+#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
+if cc.has_argument('-mavx512f')
+    code = '''#include <immintrin.h>
+    void test(__m512i zmm){
+        __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}'''
+    result = cc.compiles(code, args : '-mavx512f', name : 'AVX512 checking')
+    if result == false
+        machine_args += '-mno-avx512f'
+        warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support')
+    endif
+endif
+
 # we require SSE4.2 for DPDK
 if cc.get_define('__SSE4_2__', args: machine_args) == ''
     message('SSE 4.2 not enabled by default, explicitly enabling')
Signature · 1 line
2.17.1
#14 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH v4] build: check for broken AVX-512 compiler support

20/07/2021 15:36, Liang Ma:

Quoted 15 lines

From: Liang Ma <[email protected]>

GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887

Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype.

Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6.

This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512.

Bugzilla ID: 717

Quoted 8 lines
Fixes e6a6a138919f (net/i40e: add AVX512 vector path)
Fixes 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
Fixes 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)

Applied, thanks.