From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV6HQ-0007IR-FR for qemu-devel@nongnu.org; Tue, 01 Apr 2014 17:31:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WV6HH-0005Dq-Dv for qemu-devel@nongnu.org; Tue, 01 Apr 2014 17:31:36 -0400 Received: from mail-qa0-x22a.google.com ([2607:f8b0:400d:c00::22a]:55729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV6HH-0005Dk-9O for qemu-devel@nongnu.org; Tue, 01 Apr 2014 17:31:27 -0400 Received: by mail-qa0-f42.google.com with SMTP id k15so10307781qaq.15 for ; Tue, 01 Apr 2014 14:31:26 -0700 (PDT) Sender: Richard Henderson Message-ID: <533B3025.8010200@twiddle.net> Date: Tue, 01 Apr 2014 14:31:17 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1396385614-19267-1-git-send-email-rth@twiddle.net> <1396385614-19267-8-git-send-email-rth@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 7/9] tcg-ppc64: Define TCG_TARGET_INSN_UNIT_SIZE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On 04/01/2014 02:12 PM, Peter Maydell wrote: >> -static uint16_t reloc_pc14_val(void *pc, tcg_target_long target) >> +static uint16_t reloc_pc14_val(void *pc, tcg_insn_unit *target) > > Should be tcg_insn_unit *pc like the others I guess? Yep. >> - value += addend; >> + /* Note that we always use 0 for addend in calls to tcg_out_reloc. */ > > Is this comment saying "assert(addend == 0)" ? > >> + tcg_insn_unit *target = (tcg_insn_unit *)value; Err.. sure. I sort of had in mind to eventually change the type of "value" to tcg_insn_unit* and eliminate "addend". But that's an interface change that has to happen all at once, and that'll be easier after this set of changes is complete across all targets. >> -static const void * const qemu_st_helpers[16] = { >> +static void * const qemu_st_helpers[16] = { > > Why do we lose the extra 'const' here? We'd have to carry the const all the way through all of the relocation and pointer differencing functions. It didn't seem worth it. >> #ifndef __APPLE__ >> /* First emit adhoc function descriptor */ >> tcg_out64(s, (uint64_t)s->code_ptr + 24); /* entry point */ >> - s->code_ptr += 16; /* skip TOC and environment pointer */ >> + tcg_out64(s, 0); /* toc */ >> + tcg_out64(s, 0); /* environment pointer */ > > This is a behaviour change, right? Is it a bugfix or just a "doesn't > matter if we write zeros here or not" thing? The later. It seemed better to just write zeros than do "+= 2". r~