From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDE0Q-0001KN-NH for qemu-devel@nongnu.org; Mon, 10 Oct 2011 07:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDE0P-0002Ng-6e for qemu-devel@nongnu.org; Mon, 10 Oct 2011 07:26:50 -0400 Received: from eu1sys200aog119.obsmtp.com ([207.126.144.147]:56562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDE0O-0002NV-T8 for qemu-devel@nongnu.org; Mon, 10 Oct 2011 07:26:49 -0400 Message-ID: <4E92D66C.1060903@st.com> Date: Mon, 10 Oct 2011 13:26:36 +0200 From: Christophe Lyon MIME-Version: 1.0 References: <1317652087-27288-1-git-send-email-christophe.lyon@st.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] rsqrte_f32: No need to copy sign bit. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "qemu-devel@nongnu.org" On 09.10.2011 00:57, Peter Maydell wrote: > On 3 October 2011 15:28, Christophe Lyon wrote: >> Indeed, the result is known to be always positive. >> - val = ((val64>> 63)& 0x80000000) >> - | ((result_exp& 0xff)<< 23) >> + val = ((result_exp& 0xff)<< 23) >> | ((val64>> 29)& 0x7fffff); >> return make_float32(val); > So we weren't generating incorrect results, we were just doing > slightly more work than we really needed, right? I'm curious > what prompted this patch :-) > Exactly. And no way to expose a bug :-( I was reading 2 revisions of the ARM ARM, and noticed erratas in the descriptions of FPRecipEstimate and FPRSqrtEstimate. Sign propagation has been removed in the former, and not in the later, so I re-read both functions carefully as well as qemu's implementation and came to this conclusion :-) I have contacted ARM support and suggested them to fix both function accordingly :-) Christophe.