From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IYPpF-0006VK-8X for qemu-devel@nongnu.org; Thu, 20 Sep 2007 13:28:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IYPpD-0006Uj-7z for qemu-devel@nongnu.org; Thu, 20 Sep 2007 13:28:28 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYPpD-0006Ug-3B for qemu-devel@nongnu.org; Thu, 20 Sep 2007 13:28:27 -0400 Received: from phoenix.bawue.net ([193.7.176.60] helo=mail.bawue.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IYPpC-00088L-Ho for qemu-devel@nongnu.org; Thu, 20 Sep 2007 13:28:26 -0400 Date: Thu, 20 Sep 2007 18:28:25 +0100 From: Thiemo Seufer Message-ID: <20070920172825.GU9972@networkno.de> References: <20070919204154.GA13366@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070919204154.GA13366@caradoc.them.org> Subject: [Qemu-devel] Re: MIPS FP rounding Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Daniel Jacobowitz Cc: qemu-devel@nongnu.org Daniel Jacobowitz wrote: > Thiemo, in May you added this: > > - update_fcr31(); \ > + update_fcr31(); \ > + if (GET_FP_CAUSE(env->fcr31) & FP_INVALID) \ > + FST2 = 0x7fbfffff; \ > + else if (GET_FP_CAUSE(env->fcr31) & FP_UNDERFLOW) { \ > + if ((env->fcr31 & 0x3) == 0) \ > + FST2 &= 0x80000000ULL; \ > + } \ > > That last bit says that if underflow is detected and the rounding mode > is round-to-nearest, return an signed appropriate signed zero. Why? > The MIPS ISA docs say a rounded result is returned in this case, and > that's what's in FST2 if that code is removed. It fixed an internal testcase, I'll have to check what was going on there, probably tomorrow. Thiemo