doc: announce behavior change in bus probing
[dpdk.git] / buildtools / binutils-avx512-check.py
1 #! /usr/bin/env python3
2 # SPDX-License-Identitifer: BSD-3-Clause
3 # Copyright(c) 2020 Intel Corporation
4
5 import subprocess
6 import sys
7 import tempfile
8
9 objdump, *cc = sys.argv[1:]
10 with tempfile.NamedTemporaryFile() as obj:
11     # On Windows, the file is opened exclusively and is not writable.
12     obj.close()
13     # from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028
14     gather_params = '0x8(,%ymm1,1),%ymm0{%k2}'
15     src = '__asm__("vpgatherqq {}");'.format(gather_params).encode('utf-8')
16     subprocess.run(cc + ['-c', '-xc', '-o', obj.name, '-'], input=src, check=True)
17     asm = subprocess.run([objdump, '-d', '--no-show-raw-insn', obj.name],
18                          capture_output=True, check=True).stdout.decode('utf-8')
19     if gather_params not in asm:
20             print('vpgatherqq displacement error with as')
21             sys.exit(1)