qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Alexander Graf <agraf@suse.de>, malc <av1474@comtv.ru>
Cc: qemu-ppc <qemu-ppc@nongnu.org>,
	qemu-devel Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH for-1.1 0/3] tcg/ppc: AREG0 support and Darwin fixes
Date: Tue, 08 May 2012 22:25:55 +0200	[thread overview]
Message-ID: <4FA98153.3060707@suse.de> (raw)
In-Reply-To: <AB27F417-F96D-4C60-9D48-987A9946358F@suse.de>

Am 08.05.2012 21:42, schrieb Alexander Graf:
> 
> On 08.05.2012, at 21:29, Andreas Färber wrote:
> 
>> On patch 3/3 he didn't like my alignment macro. I don't have a better
>> one though, suggestions or patches welcome. Ideal might be some
>> ROUND_TO_ODD() macro, but the problem is that for Darwin/AIX where it's
>> no-op it shouldn't result in a "statement without effect" warning.
>> Therefore my do { } while (0) as opposed to ir = MACRO(ir).
> 
> static inline int round_reg_i64(int input_reg)
> {
> #ifdef WHATEVER_CONDITION
>     if (input_reg % 2) {
>         reg++;
>     }
> #endif
> 
>     return reg;
> }
> 
> [...]
> 
>   ir = round_reg_i64(ir);

I think he didn't like the mod check either but the suggestion
<malc> [...] reg += reg & TCG_TARGET_CALL_ALIGN_ARGS [...]
doesn't work well when TCG_TARGET_CALL_ALIGN_ARGS is undefined.
And defining it with value 0 seems unsafe to me.

What about the following? (untested)

static inline int tcg_target_call_align_i64_reg(int reg)
{
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
    /* Round up to next odd register */
    return (reg & ~1) + 1;
#else
    return reg;
#endif
}

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2012-05-08 20:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-06 23:46 [Qemu-devel] [PATCH for-1.1 0/3] tcg/ppc: AREG0 support and Darwin fixes Andreas Färber
2012-05-06 23:46 ` [Qemu-devel] [PATCH for-1.1 1/3] tcg/ppc: Do not overwrite lower address word on Darwin and AIX Andreas Färber
2012-05-06 23:46 ` [Qemu-devel] [PATCH for-1.1 2/3] tcg/ppc: Handle _CALL_DARWIN being undefined on Darwin Andreas Färber
2012-05-07  6:16   ` Andreas Färber
2012-05-06 23:46 ` [Qemu-devel] [PATCH for-1.1 3/3] tcg/ppc: Fix CONFIG_TCG_PASS_AREG0 mode Andreas Färber
2012-05-08 17:39   ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2012-05-08 17:43     ` Alexander Graf
2012-05-08 18:20       ` Alexander Graf
2012-05-08 18:32         ` Alexander Graf
2012-05-08 19:34       ` Andreas Färber
2012-05-08 19:40         ` Alexander Graf
2012-05-08 17:15 ` [Qemu-devel] [Qemu-ppc] [PATCH for-1.1 0/3] tcg/ppc: AREG0 support and Darwin fixes Alexander Graf
2012-05-08 17:39   ` malc
2012-05-08 18:09     ` Alexander Graf
2012-05-08 19:29       ` Andreas Färber
2012-05-08 19:42         ` Alexander Graf
2012-05-08 20:25           ` Andreas Färber [this message]
2012-05-08 20:28             ` malc
2012-05-08 20:32               ` Andreas Färber
2012-05-08 20:35                 ` malc
2012-05-08 20:39                   ` malc
2012-05-08 19:49     ` Andreas Färber
2012-05-08 19:58       ` malc

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=4FA98153.3060707@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=av1474@comtv.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).