From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpH6X-0004fn-Rm for qemu-devel@nongnu.org; Fri, 14 Nov 2014 08:40:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpH6O-0004vo-RZ for qemu-devel@nongnu.org; Fri, 14 Nov 2014 08:40:01 -0500 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]:38685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpH6O-0004vi-JO for qemu-devel@nongnu.org; Fri, 14 Nov 2014 08:39:52 -0500 Received: by mail-wg0-f49.google.com with SMTP id x13so19389522wgg.36 for ; Fri, 14 Nov 2014 05:39:51 -0800 (PST) Sender: Richard Henderson Message-ID: <54660622.1020106@twiddle.net> Date: Fri, 14 Nov 2014 14:39:46 +0100 From: Richard Henderson MIME-Version: 1.0 References: <1415898767-20461-1-git-send-email-kbastian@mail.uni-paderborn.de> <1415898767-20461-5-git-send-email-kbastian@mail.uni-paderborn.de> In-Reply-To: <1415898767-20461-5-git-send-email-kbastian@mail.uni-paderborn.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 4/4] target-tricore: Add instructions of RCR opcode format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bastian Koppelmann , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org On 11/13/2014 06:12 PM, Bastian Koppelmann wrote: > + tcg_gen_ext_i32_i64(t3, r3); > + tcg_gen_concat_i32_i64(t2, r2_low, r2_high); > + /* extend the sign for r2 to high 64 bits */ > + tcg_gen_sari_i64(t4, t2, 63); > + tcg_gen_ext_i32_i64(t1, r1); > + > + tcg_gen_muls2_i64(t1, t3, t1, t3); > + tcg_gen_add2_i64(t1, t3, t2, t4, t1, t3); > + I don't believe that you need 128 bit arithemetic for multiply-accumulate, either here or elsewhere (e.g. msub). Looking at unsigned, the maximum result of the multiply is 2*(2^n-1), or 2^(2n) - 2^(n+1). Which means that the accumulate with a 2^n-1 value cannot overflow a double-word intermediate result. r~