From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZkTg-0005RW-UO for qemu-devel@nongnu.org; Fri, 25 Oct 2013 12:43:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZkTX-0004vg-Gr for qemu-devel@nongnu.org; Fri, 25 Oct 2013 12:43:12 -0400 Sender: Richard Henderson Message-ID: <526A9F91.104@twiddle.net> Date: Fri, 25 Oct 2013 09:42:57 -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> In-Reply-To: <526A9B6A.7080001@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 09:25 AM, Tom Musta wrote: > > I tried recoding xsmaddadp using float64_muladd. The problem that I hit is the > boundary case where the intermediate product and the summand are infinities of > the opposite sign. This is the case handled by the first "if" in the code > snippet above. PowerPC has a dedicated FPSCR bit for this type of condition > (VXISI) as well as a general invalid operation bit (VX). As far as I can tell, > the softfloat code only has the equivalent of the VX bit. Thus the > implementation > that I proposed is a more accurate representation of the Power ISA. > > The VSX code was modeled after the existing fmadd FPU instruction. I suspect > the author of that code wrote it this way for similar reasons. > > I am inclined to keep my proposed implementation, which is consistent with > the existing PowerPC code. > > Thoughts? Hmm. I won't object to your current implementation, since it does produce correct results. 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. r~