From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Chemparathy Subject: Re: [PATCH v2 05/10] eal: add and use unaligned integer types Date: Mon, 22 Jun 2015 09:47:26 -0700 Message-ID: <20150622094726.2a751267@cchemparathy-ubuntu> References: <1434735293-15469-1-git-send-email-cchemparathy@ezchip.com> <1434735293-15469-6-git-send-email-cchemparathy@ezchip.com> <4101438.HZvvEl93na@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0070.outbound.protection.outlook.com [157.55.234.70]) by dpdk.org (Postfix) with ESMTP id B8DEEC6CA for ; Mon, 22 Jun 2015 18:47:45 +0200 (CEST) In-Reply-To: <4101438.HZvvEl93na@xps13> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 22 Jun 2015 11:36:20 +0200 Thomas Monjalon wrote: > 2015-06-19 10:34, Cyril Chemparathy: > > On machines that are strict on pointer alignment, current code > > breaks on GCC's -Wcast-align checks on casts from narrower to wider > > types. This patch introduces new unaligned_uint(16|32|64)_t types, > > which correctly retain alignment in such cases. > [...] > > +#ifdef RTE_ARCH_STRICT_ALIGN > > +typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1))); > > +typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1))); > > +typedef uint16_t unaligned_uint16_t __attribute__ ((aligned(1))); > > +#else > > +typedef uint64_t unaligned_uint64_t; > > +typedef uint32_t unaligned_uint32_t; > > +typedef uint16_t unaligned_uint16_t; > > +#endif > > CONFIG_RTE_ARCH_STRICT_ALIGN should be declared (and disabled) in > config templates. Sure. Will include in v3. I'm assuming this goes into common_linuxapp and common_bsdapp, allowing specific architectures to override if necessary. Correct?