[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/14] Add various NaN-handling macros
From: |
Nathan Froyd |
Subject: |
Re: [Qemu-devel] [PATCH 02/14] Add various NaN-handling macros |
Date: |
Tue, 3 Feb 2009 12:19:09 -0800 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
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