Received: from eggs.gnu.org ([208.118.235.92]:48535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRr1r-0004qh-NR for qemu-devel@nongnu.org; Tue, 08 May 2012 16:29:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRr1p-0005tr-FP for qemu-devel@nongnu.org; Tue, 08 May 2012 16:29:03 -0400 Date: Wed, 9 May 2012 00:28:50 +0400 (MSK) From: malc In-Reply-To: <4FA98153.3060707@suse.de> Message-ID: 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> <4FA98153.3060707@suse.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: qemu-ppc , Alexander Graf , qemu-devel Developers On Tue, 8 May 2012, Andreas F?rber wrote: > 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 > [...] 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) I'd much rather have the ifdefery scattered around the code than having to remember what this function does, but that's just me, not hard bent on it.. -- mailto:av1474@comtv.ru