This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.15-546-g8a53f50


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  8a53f50f2a8ab4e1166afa0e9a8d4abc62b0ed4e (commit)
      from  15a946b57a1e7f4ba95b63572062860ca1a5e58f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8a53f50f2a8ab4e1166afa0e9a8d4abc62b0ed4e

commit 8a53f50f2a8ab4e1166afa0e9a8d4abc62b0ed4e
Author: Kaz Kojima <kkojima@rr.iij4u.or.jp>
Date:   Thu Apr 5 11:53:49 2012 +0900

    Fix SH4 fraiseexcpt so to generate exceptions appropriately.

diff --git a/ChangeLog b/ChangeLog
index dd4a520..092756e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-04-05  Nobuhiro Iwamatsu  <iwamatsu@nigauri.org>
+
+	* sysdeps/sh/sh4/fpu/fraiseexcpt.c (feraiseexcept): Produce
+	an exception using FPU order intentionally.
+
+2012-04-05  Nobuhiro Iwamatsu  <iwamatsu@nigauri.org>
+
+	* sysdeps/sh/sh4/fpu/fedisblxcpt.c: New file.
+	* sysdeps/sh/sh4/fpu/feenablxcpt.c: New file.
+	* sysdeps/sh/sh4/fpu/fegetexcept.c: New file.
+	* sysdeps/sh/sh4/fpu/feupdateenv.c: New file.
+
 2012-04-05  Simon Josefsson  <simon@josefsson.org>
 
 	[BZ #12340]
diff --git a/sysdeps/sh/sh4/fpu/fraiseexcpt.c b/sysdeps/sh/sh4/fpu/fraiseexcpt.c
index 0bed3a5..a555b10 100644
--- a/sysdeps/sh/sh4/fpu/fraiseexcpt.c
+++ b/sysdeps/sh/sh4/fpu/fraiseexcpt.c
@@ -1,6 +1,7 @@
 /* Raise given exceptions.
-   Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2000, 2002, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
+   Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,18 +18,47 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <fenv.h>
+#include <float.h>
 #include <fpu_control.h>
 #include <math.h>
 
 int
 feraiseexcept (int excepts)
 {
+  if (excepts == 0)
+    return 0;
+
   /* Raise exceptions represented by EXPECTS.  */
-  fexcept_t temp;
-  _FPU_GETCW (temp);
-  temp |= (excepts & FE_ALL_EXCEPT);
-  temp |= (excepts & FE_ALL_EXCEPT) << 5;
-  _FPU_SETCW (temp);
+
+  if (excepts & FE_INEXACT)
+  {
+    double d = 1.0, x = 3.0;
+    __asm__ __volatile__ ("fdiv %1, %0" : "+d" (d) : "d" (x));
+  }
+
+  if (excepts & FE_UNDERFLOW)
+  {
+    long double d = LDBL_MIN, x = 10;
+    __asm__ __volatile__ ("fdiv %1, %0" : "+d" (d) : "d" (x));
+  }
+
+  if (excepts & FE_OVERFLOW)
+  {
+    long double d = LDBL_MAX;
+    __asm__ __volatile__ ("fmul %0, %0" : "+d" (d) : "d" (d));
+  }
+
+  if (excepts & FE_DIVBYZERO)
+  {
+    double d = 1.0, x = 0.0;
+    __asm__ __volatile__ ("fdiv %1, %0" : "+d" (d) : "d" (x));
+  }
+
+  if (excepts & FE_INVALID)
+  {
+    double d = HUGE_VAL, x = 0.0;
+    __asm__ __volatile__ ("fmul %1, %0" : "+d" (d) : "d" (x));
+  }
 
   return 0;
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                        |   12 ++++++++++
 sysdeps/sh/sh4/fpu/fraiseexcpt.c |   42 ++++++++++++++++++++++++++++++++-----
 2 files changed, 48 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]