From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwuS9-00009I-O6 for qemu-devel@nongnu.org; Thu, 12 Nov 2015 11:10:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwuS8-0008F6-PL for qemu-devel@nongnu.org; Thu, 12 Nov 2015 11:10:25 -0500 Received: from mail-vk0-x232.google.com ([2607:f8b0:400c:c05::232]:35819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwuS8-0008Ez-Lv for qemu-devel@nongnu.org; Thu, 12 Nov 2015 11:10:24 -0500 Received: by vkas68 with SMTP id s68so13450979vka.2 for ; Thu, 12 Nov 2015 08:10:24 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <5644A373.5060503@twiddle.net> From: Peter Maydell Date: Thu, 12 Nov 2015 16:10:04 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 1/4] target-tilegx: Add fpu header file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chen Gang Cc: Chris Metcalf , qemu-devel , Richard Henderson On 12 November 2015 at 16:04, Chen Gang wrote: > On 11/12/15 22:34, Richard Henderson wrote: >> On 11/08/2015 06:43 AM, Chen Gang wrote: >> >>> +#if !defined(HOST_WORDS_BIGENDIAN) >>> + /* According to float(uns)sisf2 and float(uns)sidf2 in gcc tilegx.md */ >>> + uint64_t exp : 8; /* exp, 0x9e: 31 + TILEGX_F_EXP_FZERO */ >>> + uint64_t uiknown0 : 2; /* unknown */ >> >> I would really rather you didn't use bitfields, because of exactly this sort of endianness problem. Because, really, you can't trust this layout. But I won't press this point, because it is complicated enough already. >> > > Because of endianess issues, for me, I don't like bit fields either. But > I can not find any other simpler ways than current. > OK, I shall remove them. > >>> +#pragma pack(pop) >> >> Huh? What are you attempting to do here? >> > > It is for matching "#pragma pack(push, 1)" which is above all related > struct/unions in this header file. Please don't use 'pragma pack' or bitfields. If you need to pack and unpack things from a target-CPU defined field use bit operations and/or extract32/deposit32/extract64/deposit64. thanks -- PMM