From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEjYP-0006zv-KJ for qemu-devel@nongnu.org; Wed, 28 Aug 2013 13:29:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEjYK-0005xX-Kb for qemu-devel@nongnu.org; Wed, 28 Aug 2013 13:29:13 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:39424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEjYK-0005wg-E4 for qemu-devel@nongnu.org; Wed, 28 Aug 2013 13:29:08 -0400 Received: by mail-lb0-f178.google.com with SMTP id z5so5011157lbh.37 for ; Wed, 28 Aug 2013 10:29:07 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <521E3086.1030003@twiddle.net> References: <1377664796-11698-1-git-send-email-sw@weilnetz.de> <521E09DF.20102@twiddle.net> <521E16B3.3030008@twiddle.net> <521E3086.1030003@twiddle.net> From: Peter Maydell Date: Wed, 28 Aug 2013 18:28:47 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [RFC] Streamlining endian handling in TCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel , Aurelien Jarno On 28 August 2013 18:16, Richard Henderson wrote: > On 08/28/2013 09:38 AM, Peter Maydell wrote: >>> (B) Add an additional bit to the "opc" to indicate which endianness is desired. >>> E.g. 0 = LE, 8 = BE. Expose the opc interface to the translators. At which >>> point generating a load becomes more like >>> >>> tcg_gen_qemu_ld_tl(dest, addr, size | sign | dc->big_endian); >>> >>> and the current endianness of the guest becomes a bit on the TB, to be copied >>> into the DisasContext at the beginning of translation. >> >> I guess we deal with ARMv5-style BE32 by having the target >> emit an explicit XOR TCG op? > > Yes. I see no other way to implement that. > >> Do we need to overhaul the C interface to the >> memory system too? (ie ldl_p and friends). > > I don't think so, since we already have ldl_{le,be}_p. Well, what do ldl_p or ldl_phys or any of the other functions without an le/be qualifier mean any more if "is this CPU in big endian mode?" now requires you to have a CPUState to ask? I guess we can tackle that separately from getting the assumptions on endianness out of the tcg backends though. -- PMM