From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0AD89A0032; Tue, 21 Jun 2022 11:39:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F01F4069C; Tue, 21 Jun 2022 11:39:00 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 1E2B440151 for ; Tue, 21 Jun 2022 11:38:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655804339; x=1687340339; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=fXuCCpVTDZCo05D98jHqePhBDiKEtYDRY9uOCvIZCpU=; b=c4/uqLvkshQRSCpCKChUoNm4Qb1Hxrd9Nm84XBvkMGPnPj3YkYC4I8AP AwIjVUNeq0ZzbKyx1UZeHvFyzGQmia7OsczAODFyjIRelA55osnYp7VUy 0wKKRcDTGdohzFkOypG15EfNYpD9KB+FKL/E7oPSos71nh/8/EXLK40Rx HH2fahqD/SFcJDZ930Uca4v7nrqTUi8bTjpsrMbM2ySHGCpyriv2Wtyuf CDCpryWHdnuFylXEZlOaA9TopYpIoCsAgkVinqqocuiAT3WaCQ53ZFZlu pNR7taLl/q+0RYDEAF+p6awxTZF0WuAmKwx36o0SLj3gPuNKZsdoDEYJu g==; X-IronPort-AV: E=McAfee;i="6400,9594,10384"; a="260508853" X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="260508853" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 02:38:57 -0700 X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="643544769" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.10.248]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 21 Jun 2022 02:38:54 -0700 Date: Tue, 21 Jun 2022 10:38:47 +0100 From: Bruce Richardson To: =?utf-8?Q?Stanis=C5=82aw?= Kardach Cc: David Christensen , David Marchand , dev , upstream@semihalf.com, Aaron Conole , "Ananyev, Konstantin" , "Ruifeng Wang (Arm Technology China)" , Jerin Jacob Kollanukkaran Subject: Re: [PATCH 0/3] Fix xmm_t to rte_xmm_t scalar conversion Message-ID: References: <20220609121701.716299-1-kda@semihalf.com> <63ed6e6c-337d-8f8a-9410-1e43b0561967@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Jun 21, 2022 at 11:30:32AM +0200, Stanisław Kardach wrote: > On Tue, Jun 21, 2022 at 12:54 AM David Christensen > wrote: > > > > > On Thu, Jun 9, 2022 at 2:17 PM Stanislaw Kardach wrote: > > >> > > >> As David noticed in [1] there is an issue with C++ compilation of the > > >> rte_vect.h header in RISC-V. Upon closer inspection, the problem appears on > > >> all architectures due to the type conversion rules in C++. > > >> More precisely a union type rte_xmm_t requires a conversion constructor > > >> from xmm_t type. > > >> The most obvious fix is to use a structure initializer for such copies > > >> (since rte_xmm_t union contains xmm_t anyway). The generated assembly > > >> at -O2 is exactly the same, so there's no real impact. > > >> > > >> The bigger question is whether accessing bits of the architecture specific > > >> xmm_t type in an array fashion is always correct? All current architectures > > >> define rte_xmm_t in the same manner implying that. > > > > > > Copying other arch maintainers. > > > > My read of the Altivec vector layout for LE systems says the existing > > union operator rte_xmm_t is correct, though my C++ experience is > > limited. How can I generate an error with C++ to expose this issue? > > > > Dave > To replicate this issue: > 1. Apply the patch below. In essence it forces the use of scalar lpm > and changes C++ compiler to g++ so that meson properly detects it. > Otherwise C++ checks won't be generated. > 2. Configure build with: meson build-ppc64le --werror --cross-file > config/ppc/ppc64le-power8-linux-gcc-ubuntu -Dcheck_includes=true > 3. Build with: ninja -C build-ppc64le buildtools/chkincs/chkincs-cpp > > Note that the build target only gets generated if C++ compiler is > properly discovered by meson. To be honest I'm not sure why > powerpc64le-linux-gnu-cpp doesn't get properly picked up by meson. Generally the "cpp" binary is not the c-plus-plus one, but the C preprocessor one. Perhaps the original files are incorrect here, and should all refer to g++. /Bruce