From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IY6Mv-0007Wg-Jf for qemu-devel@nongnu.org; Wed, 19 Sep 2007 16:41:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IY6Mu-0007WU-SV for qemu-devel@nongnu.org; Wed, 19 Sep 2007 16:41:57 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IY6Mu-0007WR-N8 for qemu-devel@nongnu.org; Wed, 19 Sep 2007 16:41:56 -0400 Received: from nan.false.org ([208.75.86.248]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IY6Mu-0002AB-EZ for qemu-devel@nongnu.org; Wed, 19 Sep 2007 16:41:56 -0400 Date: Wed, 19 Sep 2007 16:41:54 -0400 From: Daniel Jacobowitz Message-ID: <20070919204154.GA13366@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] 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: qemu-devel@nongnu.org, Thiemo Seufer 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. This shows up in the mul-subnormal-single-1.c test from GCC's ieee.exp. -- Daniel Jacobowitz CodeSourcery