[PATCH 3/4 v2] [SH/SH4]: Set fpcsr register which read again

Thomas Schwinge thomas@codesourcery.com
Tue May 29 13:13:00 GMT 2012


Hi!

On Tue, 29 May 2012 14:47:14 +0200, I wrote:
> On Thu, 24 May 2012 08:43:04 +0900, Nobuhiro Iwamatsu <iwamatsu@nigauri.org> wrote:
> > 2012/5/23 Kaz Kojima <kkojima@rr.iij4u.or.jp>:
> > > Thomas Schwinge <thomas@codesourcery.com> wrote:
> > >>> +  /* When read fpscr, this was initialized.
> > >>> +     We need to rewrite value of temp. */
> > >>> +  _FPU_SETCW (temp);
> > >>>
> > >>>    return temp & excepts & FE_ALL_EXCEPT;
> > >>>  }
> > >>
> > >> Why is this needed?  It seems that I can't find it neither in the SH-4A
> > >> Software Manual nor in the SH7785 Hardware Manual.
> > >
> > > I thought that there was an errata for the issue, though I can't
> > > find the corresponding documentation ATM.  Iwamatsu-san?
> 
> > When fetestexcept was called, the problem from which the information
> > on fpscr is deleted occurred.
> > To be sure, it is not writing to the manual.
> > I checked this problem using the Linux kernel.
> > I think that it may be a problem by the side of a Linux kernel...
> 
> I see.  Will you be working on resolving that?  Because, currently the
> state is inconsistent: sometimes fpscr is reloaded, sometimes not
> (ftestexcept, as well as (potentially) all generic uses of _FPU_GETCW
> outside of our control).

Sorry, ftestexcept is covered, fegetround is where it is missing.

> If there indeed is an erratum regarding this, how about we directly add
> an _FPU_SETCW call to the _FPU_GETCW macro?  This will be redundant for
> most cases (when a different value is stored afterwards), but will at
> least cover all usage of _FPU_GETCW.  But I'd rather prefer to first
> clarify why/where this is really needed.  (Based on glibc's test suite,
> it is not needed for our SH7785 board; makes no difference when reverting
> your patch.)


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120529/473fde99/attachment.sig>


More information about the Libc-alpha mailing list