From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2nTk-0002K9-73 for qemu-devel@nongnu.org; Thu, 03 Jul 2014 16:19:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2nTZ-0002BW-2O for qemu-devel@nongnu.org; Thu, 03 Jul 2014 16:19:36 -0400 Received: from mail-qc0-x22d.google.com ([2607:f8b0:400d:c01::22d]:38085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2nTY-0002B9-U3 for qemu-devel@nongnu.org; Thu, 03 Jul 2014 16:19:24 -0400 Received: by mail-qc0-f173.google.com with SMTP id l6so716132qcy.18 for ; Thu, 03 Jul 2014 13:19:23 -0700 (PDT) Sender: Richard Henderson Message-ID: <53B5BAC7.1010603@twiddle.net> Date: Thu, 03 Jul 2014 13:19:19 -0700 From: Richard Henderson MIME-Version: 1.0 References: <53B1AEEF.8010108@twiddle.net> <20140630205635.GG18016@ZenIV.linux.org.uk> <53B2E9CA.4040802@twiddle.net> <20140701175036.GJ18016@ZenIV.linux.org.uk> <53B2FE3B.6050306@twiddle.net> <20140702040508.GK18016@ZenIV.linux.org.uk> <53B41E36.30906@twiddle.net> <20140702152027.GN18016@ZenIV.linux.org.uk> <20140703065104.GP18016@ZenIV.linux.org.uk> <20140703182501.GQ18016@ZenIV.linux.org.uk> In-Reply-To: <20140703182501.GQ18016@ZenIV.linux.org.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Al Viro Cc: Peter Maydell , QEMU Developers On 07/03/2014 11:25 AM, Al Viro wrote: > On Thu, Jul 03, 2014 at 07:51:04AM +0100, Al Viro wrote: > >> FWIW, why not just generate >> trunc_i64_i32 tmp, va >> trunc_i64_i32 tmp2, vb >> muls2_i32 tmp2, tmp, tmp, tmp2 >> ext32s_i64 vc, tmp2 >> maybe_overflow_32 tmp >> where maybe_overflow throws IOV unless tmp is 0 or -1? >> to suffice for mull/v. mulq/v would be >> muls2_i64 vc, tmp, va, vb >> maybe_overflow_64 tmp >> addl/v: >> trunc_i64_i32 tmp, va >> trunc_i64_i32 tmp2, vb >> add2_i32 tmp2, tmp, tmp, zero, tmp2, zero >> ext32s_i64 vc, tmp2 >> maybe_overflow_32 tmp >> etc. > > Grr... Wrong check, obviously - we want to check that tmp + MSB(tmp2) is 0. > Something like > setcond_32 tmp2, tmp2, zero, TCG_COND_LT > add_i32 tmp, tmp2, tmp > call helper_IOV_if_not_zero tmp > for 32bit ones and > setcond_64 tmp2, vc, zero, TCG_COND_LT > add_i64 tmp, tmp2, tmp > call helper_IOV_if_not_zero tmp > for 64bit ones, or would it be better just to pass both arguments to helper > and let it deal with the check? I'm not familiar enough with TCG, sorry... > I believe I have a tidy solution to these /v insns. New patch set shortly. r~