diff options
author | Kaz Kojima <kkojima@rr.iij4u.or.jp> | 2012-04-05 11:57:03 +0900 |
---|---|---|
committer | Kaz Kojima <kkojima@rr.iij4u.or.jp> | 2012-04-05 11:57:03 +0900 |
commit | 2ecccfc97ac9e755f6b67fa0bac785148c7b8256 (patch) | |
tree | 00b574fa18c2b9af6399c6c4dc0e6109402177d2 | |
parent | 8a53f50f2a8ab4e1166afa0e9a8d4abc62b0ed4e (diff) | |
download | glibc-2ecccfc97ac9e755f6b67fa0bac785148c7b8256.tar glibc-2ecccfc97ac9e755f6b67fa0bac785148c7b8256.tar.gz glibc-2ecccfc97ac9e755f6b67fa0bac785148c7b8256.tar.bz2 glibc-2ecccfc97ac9e755f6b67fa0bac785148c7b8256.zip |
Set SH fpcsr register which read again.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fegetenv.c | 6 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/ftestexcept.c | 3 |
3 files changed, 14 insertions, 1 deletions
@@ -1,5 +1,11 @@ 2012-04-05 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> + * sysdeps/sh/sh4/fpu/fegetenv.c (fegetenv): Set fpscr register which + read again. + * sysdeps/sh/sh4/fpu/ftestexcept.c: Likewise. + +2012-04-05 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> + * sysdeps/sh/sh4/fpu/fraiseexcpt.c (feraiseexcept): Produce an exception using FPU order intentionally. diff --git a/sysdeps/sh/sh4/fpu/fegetenv.c b/sysdeps/sh/sh4/fpu/fegetenv.c index 68687dc2d1..3103316e34 100644 --- a/sysdeps/sh/sh4/fpu/fegetenv.c +++ b/sysdeps/sh/sh4/fpu/fegetenv.c @@ -1,5 +1,5 @@ /* Store current floating-point environment. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,6 +24,10 @@ fegetenv (fenv_t *envp) { unsigned long int temp; _FPU_GETCW (temp); + /* When read fpscr, this was initialized. + We need to rewrite value of temp. */ + _FPU_SETCW (temp); + envp->__fpscr = temp; return 0; diff --git a/sysdeps/sh/sh4/fpu/ftestexcept.c b/sysdeps/sh/sh4/fpu/ftestexcept.c index 9e0bfc5c27..c2e1772a91 100644 --- a/sysdeps/sh/sh4/fpu/ftestexcept.c +++ b/sysdeps/sh/sh4/fpu/ftestexcept.c @@ -26,6 +26,9 @@ fetestexcept (int excepts) /* Get current exceptions. */ _FPU_GETCW (temp); + /* When read fpscr, this was initialized. + We need to rewrite value of temp. */ + _FPU_SETCW (temp); return temp & excepts & FE_ALL_EXCEPT; } |