From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LURjn-0004pr-Py for qemu-devel@nongnu.org; Tue, 03 Feb 2009 15:19:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LURjm-0004oV-3B for qemu-devel@nongnu.org; Tue, 03 Feb 2009 15:19:15 -0500 Received: from [199.232.76.173] (port=50644 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LURjl-0004oQ-Pk for qemu-devel@nongnu.org; Tue, 03 Feb 2009 15:19:13 -0500 Received: from mx20.gnu.org ([199.232.41.8]:30512) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LURjl-0000xn-K4 for qemu-devel@nongnu.org; Tue, 03 Feb 2009 15:19:13 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LURjj-0005XS-Sx for qemu-devel@nongnu.org; Tue, 03 Feb 2009 15:19:12 -0500 Date: Tue, 3 Feb 2009 12:19:09 -0800 From: Nathan Froyd Subject: Re: [Qemu-devel] [PATCH 02/14] Add various NaN-handling macros Message-ID: <20090203201908.GD15286@codesourcery.com> References: <1232657054-30100-1-git-send-email-froydnj@codesourcery.com> <1232657054-30100-3-git-send-email-froydnj@codesourcery.com> <20090203194114.GA18984@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090203194114.GA18984@volta.aurel32.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On Tue, Feb 03, 2009 at 08:41:14PM +0100, Aurelien Jarno wrote: > On Thu, Jan 22, 2009 at 12:44:02PM -0800, Nathan Froyd wrote: > > These simplify the implementation of the floating-point Altivec > > instructions and reduce clutter. > > > > +#undef DO_HANDLE_NAN > > +#undef HANDLE_NAN1 > > +#undef HANDLE_NAN2 > > +#undef HANDLE_NAN3 > > #undef VECTOR_FOR_INORDER_I > > #undef HI_IDX > > #undef LO_IDX > > This is something already handled by the softfloat code. You should use > set_default_nan_mode(1, &env->vec_status) to get this behavior. This > could probably done directly in the init code. I saw the set_default_nan_mode and considered using it. It doesn't give the same results as the above macros, though. The Altivec specs say that if a particular input is a SNaN, then the output is the corresponding QNaN, not the default NaN for the platform. The default NaN is only used in specific instances. Also, QNaNs propagate through Altivec operations; using set_default_nan_mode would mean that the correct propagation no longer occurs. -Nathan