From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRqyu-0003wC-VM for qemu-devel@nongnu.org; Tue, 08 May 2012 16:26:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRqyt-0004YO-6N for qemu-devel@nongnu.org; Tue, 08 May 2012 16:26:00 -0400 Message-ID: <4FA98153.3060707@suse.de> Date: Tue, 08 May 2012 22:25:55 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1336347984-3714-1-git-send-email-afaerber@suse.de> <879932B6-7B16-4ED2-971F-5BC708B5BDCF@suse.de> <1BDFB320-4ADB-4D97-972A-0031BF6FF305@suse.de> <4FA9741D.10804@suse.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH for-1.1 0/3] tcg/ppc: AREG0 support and Darwin fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , malc Cc: qemu-ppc , qemu-devel Developers Am 08.05.2012 21:42, schrieb Alexander Graf: >=20 > On 08.05.2012, at 21:29, Andreas F=E4rber wrote: >=20 >> 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 =3D MACRO(ir). >=20 > static inline int round_reg_i64(int input_reg) > { > #ifdef WHATEVER_CONDITION > if (input_reg % 2) { > reg++; > } > #endif >=20 > return reg; > } >=20 > [...] >=20 > ir =3D round_reg_i64(ir); I think he didn't like the mod check either but the suggestion [...] reg +=3D 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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg