From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 453BEA0519; Fri, 3 Jul 2020 12:35:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5612E1DB25; Fri, 3 Jul 2020 12:35:34 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id C39521DB14 for ; Fri, 3 Jul 2020 12:35:32 +0200 (CEST) IronPort-SDR: SUZh8iY+SAJL9YV9cMxQKWiefoHGhyIcAoCo2NIAiypVkv9lzKf8fDJZbdlf/SnohjFP4B0RvJ xHGP6g8E1tDQ== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="212154179" X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="212154179" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2020 03:35:31 -0700 IronPort-SDR: 9/j0z+OlN8i0c64ciKxUzqfwMKACAmAKyG8KHJr0KtZQ7RD9Rw4JAJxezcY74wo02YBjKOz7uT vrh8FY4Krj9Q== X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="455859084" Received: from dhowell-mobl2.ger.corp.intel.com (HELO bricha3-MOBL.ger.corp.intel.com) ([10.252.2.251]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 03 Jul 2020 03:35:30 -0700 Date: Fri, 3 Jul 2020 11:35:26 +0100 From: Bruce Richardson To: Thomas Monjalon Cc: dev@dpdk.org, ferruh.yigit@intel.com Message-ID: <20200703103526.GC620@bricha3-MOBL.ger.corp.intel.com> References: <20200617104012.470617-1-bruce.richardson@intel.com> <20200618115644.488930-1-bruce.richardson@intel.com> <2483193.BHUjs1tvcQ@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2483193.BHUjs1tvcQ@thomas> Subject: Re: [dpdk-dev] [PATCH v2] build: check functionality rather than binutils version X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jul 02, 2020 at 11:28:51PM +0200, Thomas Monjalon wrote: > 18/06/2020 13:56, Bruce Richardson: > > Rather than checking the binutils version number, which can lead to > > unnecessary disabling of AVX512 if fixes have been backported to distro > > versions, we can instead check the output of "as" from binutils to see if > > it is correct. > > > > The check in the script uses the minimal assembly reproduction code posted > > to the public bug tracker for gcc/binutils for those issues [1]. If the > > binutils bug is present, the instruction parameters - specifically the > > displacement parameter - will be different in the disassembled output > > compared to the input. Therefore the check involves assembling a single > > instruction and disassembling it again, checking that the two match. > [...] > > --- /dev/null > > +++ b/buildtools/binutils-avx512-check.sh > > +MESON_BUILD_ROOT=${MESON_BUILD_ROOT:-/tmp} > > +OBJFILE=$MESON_BUILD_ROOT/binutils-avx512-check.o > > +# from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028 > > +GATHER_PARAMS='0x8(,%ymm1,1),%ymm0{%k2}' > > + > > +# assemble vpgather to file and similarly check > > +echo "vpgatherqq $GATHER_PARAMS" | $AS --64 -o $OBJFILE - > > +objdump -d --no-show-raw-insn $OBJFILE | grep -q $GATHER_PARAMS || { > > + echo "vpgatherqq displacement error with as" > > + exit 1 > > +} > > For the temporary OBJFILE, please use mktemp and trap for cleanup. > If you grep "mktemp" in DPDK, you will see the filename is pretty well > standardized with "dpdk." as prefix. > Thanks > Will change for v3