qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 7/9] tcg-ppc64: Define TCG_TARGET_INSN_UNIT_SIZE
Date: Tue, 01 Apr 2014 14:31:17 -0700	[thread overview]
Message-ID: <533B3025.8010200@twiddle.net> (raw)
In-Reply-To: <CAFEAcA9JC8rwNLM=4=3JVO_eVvpHkmZ5cLKTyksnjV_1Sv3YRg@mail.gmail.com>

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~

  reply	other threads:[~2014-04-01 21:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 20:53 [Qemu-devel] [PATCH v2 0/9] tcg: tidy the type of code_ptr Richard Henderson
2014-04-01 20:53 ` [Qemu-devel] [PATCH v2 1/9] exec-all.h: Use stl_p to avoid undefined behaviour patching x86 jumps Richard Henderson
2014-04-01 20:53 ` [Qemu-devel] [PATCH v2 2/9] tcg: Avoid stores to unaligned addresses Richard Henderson
2014-04-01 20:53 ` [Qemu-devel] [PATCH v2 3/9] tcg: Avoid undefined behaviour patching code at " Richard Henderson
2014-04-01 20:53 ` [Qemu-devel] [PATCH v2 4/9] tcg: Introduce byte pointer arithmetic helpers Richard Henderson
2014-04-01 20:53 ` [Qemu-devel] [PATCH v2 5/9] tcg: Define tcg_insn_unit for code pointers Richard Henderson
2014-04-01 20:53 ` [Qemu-devel] [PATCH v2 6/9] tcg-i386: Define TCG_TARGET_INSN_UNIT_SIZE Richard Henderson
2014-04-01 20:53 ` [Qemu-devel] [PATCH v2 7/9] tcg-ppc64: " Richard Henderson
2014-04-01 21:12   ` Peter Maydell
2014-04-01 21:31     ` Richard Henderson [this message]
2014-04-01 20:53 ` [Qemu-devel] [PATCH v2 8/9] tcg-ppc: " Richard Henderson
2014-04-01 20:53 ` [Qemu-devel] [PATCH v2 9/9] tcg-sparc: " Richard Henderson
2014-04-01 21:15 ` [Qemu-devel] [PATCH v2 0/9] tcg: tidy the type of code_ptr Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533B3025.8010200@twiddle.net \
    --to=rth@twiddle.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).