From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2DrD-00064i-0T for qemu-devel@nongnu.org; Wed, 02 Jul 2014 02:17:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2DrC-0006pG-2M for qemu-devel@nongnu.org; Wed, 02 Jul 2014 02:17:26 -0400 Received: from zeniv.linux.org.uk ([2002:c35c:fd02::1]:43581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2DrB-0006oJ-RK for qemu-devel@nongnu.org; Wed, 02 Jul 2014 02:17:25 -0400 Date: Wed, 2 Jul 2014 07:17:23 +0100 From: Al Viro Message-ID: <20140702061723.GM18016@ZenIV.linux.org.uk> References: <20140625070117.GD18016@ZenIV.linux.org.uk> <20140626055541.GF18016@ZenIV.linux.org.uk> <53B1AEEF.8010108@twiddle.net> <20140630205635.GG18016@ZenIV.linux.org.uk> <53B2E9CA.4040802@twiddle.net> <20140701175036.GJ18016@ZenIV.linux.org.uk> <53B2FE3B.6050306@twiddle.net> <20140702040508.GK18016@ZenIV.linux.org.uk> <20140702055027.GL18016@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140702055027.GL18016@ZenIV.linux.org.uk> Sender: Al Viro Subject: Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Peter Maydell , QEMU Developers On Wed, Jul 02, 2014 at 06:50:27AM +0100, Al Viro wrote: > AFAICS, it leaves two possibilities - EV45 (AS200) vs. EV6 (DS10) and EV67 > (qemu) _or_ some change in the kernel. I'll build 3.x kernel for DS10 and > post the results; shouldn't take long... Actually, it's simpler - note that on *all* systems we end up with FPCR.INE set. So this swcr_update_status(unsigned long swcr, unsigned long fpcr) { /* EV6 implements most of the bits in hardware. Collect the acrued exception bits from the real fpcr. */ if (implver() == IMPLVER_EV6) { swcr &= ~IEEE_STATUS_MASK; swcr |= (fpcr >> 35) & IEEE_STATUS_MASK; } return swcr; } ends up with FE_INEXACT set on everything that has implver() return 2. Which is what EV6 and EV67 do and which is what qemu does by default. So no, it's not a kernel version difference; it's all kernel versions ignoring FPCR.INE when it calculates ieee_state on EV45 and using it on EV6 and friends. If we don't want FE_INEXACT seen by fetestexcept() after rounding 4.5, we'd better not use FPCR.INE - *all* variants of actual hardware (at least from 21064A to 21264) set that sucker, and 4.7 in Architecture Reference Manual very clearly requires such behaviour for any subset that isn't completely without floating point support.