From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZlCv-00060I-3s for qemu-devel@nongnu.org; Fri, 25 Oct 2013 13:30:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZlCn-0001VD-QW for qemu-devel@nongnu.org; Fri, 25 Oct 2013 13:29:57 -0400 Sender: Richard Henderson Message-ID: <526AAA66.90508@twiddle.net> Date: Fri, 25 Oct 2013 10:29:10 -0700 From: Richard Henderson MIME-Version: 1.0 References: <526947CA.4020504@gmail.com> <526949E1.3010405@gmail.com> <5269852E.9000601@twiddle.net> <526A9B6A.7080001@gmail.com> <526A9F91.104@twiddle.net> <526AA6C4.3070507@gmail.com> In-Reply-To: <526AA6C4.3070507@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 13/19] Add VSX ISA2.06 Multiply Add Instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tom Musta , QEMU Developers Cc: "qemu-ppc@nongnu.org" On 10/25/2013 10:13 AM, Tom Musta wrote: > On 10/25/2013 11:42 AM, Richard Henderson wrote: >> I believe that a better implementation could use float*_muladd, and check the >> result for float_flag_invalid. If set, compute the intermediate product so you >> can figure out the VXISI setting. But we'd expect that to be an unlikely path. > > Interesting thought. I think I see a way to re-arrange the code. Thanks, > Richard. Actually, you don't even have to compute the intermediate product. The only way you can have VXISI for a*b+c is for isinf(c) && (isinf(a) || isinf(b)) since the intermediate product a*b is infinite precision, and thus cannot overflow to inf unless one of the multiplicands is already inf. r~