From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzWDb-0001DQ-JH for qemu-devel@nongnu.org; Fri, 12 Dec 2014 14:49:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzWDS-0008UW-Hg for qemu-devel@nongnu.org; Fri, 12 Dec 2014 14:49:39 -0500 Received: from mail-qa0-x22b.google.com ([2607:f8b0:400d:c00::22b]:35733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzWDS-0008US-Ce for qemu-devel@nongnu.org; Fri, 12 Dec 2014 14:49:30 -0500 Received: by mail-qa0-f43.google.com with SMTP id bm13so5689700qab.30 for ; Fri, 12 Dec 2014 11:49:30 -0800 (PST) Sender: Richard Henderson Message-ID: <548B46C6.2060502@twiddle.net> Date: Fri, 12 Dec 2014 11:49:26 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1418405504-11175-1-git-send-email-kbastian@mail.uni-paderborn.de> <1418405504-11175-3-git-send-email-kbastian@mail.uni-paderborn.de> In-Reply-To: <1418405504-11175-3-git-send-email-kbastian@mail.uni-paderborn.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/8] target-tricore: Add instructions of RR opcode format, that have 0xb as the first opcode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bastian Koppelmann , qemu-devel@nongnu.org On 12/12/2014 09:31 AM, Bastian Koppelmann wrote: > +#define SSOV16(env, hw0, hw1) do { \ > + int32_t max_pos = INT16_MAX; \ > + int32_t max_neg = INT16_MIN; \ ... > +#define SUOV16(env, hw0, hw1) do { \ > + int32_t max_pos = UINT16_MAX; \ > + int32_t av0, av1; \ Similarly, make these functions. Best if you have these functions return the combined word, i.e. > + return (ret_hw0 & 0xffff) | (ret_hw1 << 16); so that you don't try to return the two separate inputs via reference. > +/* ret = (r1 cond r2) ? 0xFFFFFFFF ? 0x00000000;*/ > +static inline void gen_cond_w(TCGCond cond, TCGv ret, TCGv r1, TCGv r2) > +{ > + TCGv temp = tcg_temp_new(); > + > + tcg_gen_setcond_tl(cond, temp, r1, r2); > + tcg_gen_movi_tl(ret, 0); > + tcg_gen_sub_tl(ret, ret, temp); tcg_gen_neg_tl, at which point you don't need a temporary. r~