build: check AVX512 rather than binutils version
[dpdk.git] / buildtools / binutils-avx512-check.sh
1 #! /bin/sh
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright(c) 2020 Intel Corporation
4
5 AS=${AS:-as}
6 OBJFILE=$(mktemp -t dpdk.binutils-check.XXXXXX.o)
7 trap 'rm -f "$OBJFILE"' EXIT
8 # from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028
9 GATHER_PARAMS='0x8(,%ymm1,1),%ymm0{%k2}'
10
11 # assemble vpgather to file and similarly check
12 echo "vpgatherqq $GATHER_PARAMS" | $AS --64 -o $OBJFILE -
13 objdump -d  --no-show-raw-insn $OBJFILE | grep -q $GATHER_PARAMS || {
14         echo "vpgatherqq displacement error with as"
15         exit 1
16 }