This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] fix SPU feholdexcept to properly clear fpscr
- From: Patrick Mansfield <patmans at us dot ibm dot com>
- To: newlib at sourceware dot org, Jeff Johnston <jjohnstn at redhat dot com>
- Date: Wed, 25 Apr 2007 09:36:09 -0700
- Subject: Re: [PATCH] fix SPU feholdexcept to properly clear fpscr
- References: <20070419162213.GA17561@us.ibm.com>
Ping ...
On Thu, Apr 19, 2007 at 09:22:13AM -0700, Patrick Mansfield wrote:
> Jeff - can you apply this?
>
> Fix a bug in feholdexcept, use *envp not env so we clear the proper bits
> in the fpscr, and don't set some random ones.
>
> newlib ChangeLog:
>
> 2007-04-19 Patrick Mansfield <patmans@us.ibm.com>
>
> * feholdexcept.h: Use *envp not env so we clear the proper bits in
> the fpscr, and don't set some random ones.
>
> Index: my-base-quilt/newlib/libm/machine/spu/headers/feholdexcept.h
> ===================================================================
> --- my-base-quilt.orig/newlib/libm/machine/spu/headers/feholdexcept.h
> +++ my-base-quilt/newlib/libm/machine/spu/headers/feholdexcept.h
> @@ -44,7 +44,7 @@ static __inline int _feholdexcept(fenv_t
>
> fpscr = spu_mffpscr();
> *envp = __pack_fpscr(fpscr);
> - env = env & ~FE_ALL_EXCEPT;
> + env = *envp & ~FE_ALL_EXCEPT;
> spu_mtfpscr(__unpack_fpscr(env));
> return (0);
> }